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.
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.
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$.