# 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}$ 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. Oct 27 '14 at 18:02
• @KBusc The $\delta$ symbol behaves weird in links, apparently. Oct 27 '14 at 18:07
• @HennoBrandsma try this one en.wikipedia.org/wiki/G%CE%B4_set 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$.

For first part there does not exist any function Because f is discontinuous on only F-sigma set. F-sigma set is defined as the set which can be written as countable union of closed set.

• Can you clear why this happens?
– Ppp
Oct 21 '19 at 13:57