0

Let $f$ be a function from $\Bbb R$ to $\Bbb R$ such that $f(x)$ is rational when $x$ is irrational, and $f(x)$ is irrational when $x$ is rational. Can $f$ be continuous?

Thanks for your help.

1 Answers1

0

Not possible.

Let $x_1,x_2$ be irrational. If $f(x_1)\neq f(x_2)$ then the range $[f(x_1),f(x_2)]$ would contain uncountably many irrationals that would have to be in the range of $f(\mathbb{Q})$, which is impossible. Therefore $f$ is constant on irrationals. By the density of irrationals $f=const$.

Michael
  • 1,726
  • This answer has the oddity of being simultaneously accepted and downvoted. Would the downvoter explain the reason for -1? – Michael Feb 21 '14 at 21:14