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

7.9k Views Asked by At

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?
2

There are 2 best solutions below

0
On

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

0
On

The set of discontinuities of any real function must be the countable union of closed sets.

The rationals, Q, is such a set, and so your Case #2 does exist (and should be easily Googled). But the irrationals are not the countable collection of closed sets, so your Case #1 does not exist.