# Does there exist a function that is continuous at every rational point and discontinuous at every irrational point? And vice versa?

Actually there are 2 questions, but they are closely related. Does it exist a function that is:

1. Continuous at every rational point and discontinuous at every irrational point?
2. Continuous at every irrational point and discontinuous at every rational point?
• No, for the reason that $\bar{\mathbb{Q}}=\mathbb{R}$ and also $\bar{\mathbb{R}-\mathbb{Q}}=\mathbb{R}$ – Martigan Oct 27 '14 at 17:57
• Yes for continuous only at the irrationals, no for continuous only at the rationals. See en.wikipedia.org/wiki/Gδ_set where all is explained. – Henno Brandsma Oct 27 '14 at 18:02
• @HennoBrandsma your link is broken – KBusc Oct 27 '14 at 18:06
• @KBusc The $\delta$ symbol behaves weird in links, apparently. – Henno Brandsma Oct 27 '14 at 18:07
• @HennoBrandsma try this one en.wikipedia.org/wiki/G%CE%B4_set – KBusc Oct 27 '14 at 18:08

For part 2, let $f(p/q)=1/q$ for rational points $p/q$ (in reduced form) and $f(x)=0$ for irrational $x$.