# no continuous function switches the rational and the irrational numbers

Let $\mathbb{J}=\mathbb{R}\setminus\mathbb{Q}$ denote the irrationals. There is no continuous function   $f\colon\mathbb{R}\to\mathbb{R}$ such that $f(\mathbb{Q})\subseteq\mathbb{J}$ and $f(\mathbb{J})\subseteq\mathbb{Q}$.

Proof

Suppose there is such a function $f$.

First, $\mathbb{Q}=\bigcup\limits_{i\in\mathbb{N}}{\{q_{i}\}}$ implies

 $f(\mathbb{Q})=\bigcup\limits_{i\in\mathbb{N}}{\{f(q_{i})\}}.$

And then, $f(\mathbb{Q})$ is first category, because every singleton in $\mathbb{R}$ is nowhere dense (because $\mathbb{R}$ with the Euclidean metric has no isolated points, so the interior of a singleton is empty).

But $f(\mathbb{J})\subseteq\mathbb{Q}$, so $f(\mathbb{J})$ is first category too. Therefore $f(\mathbb{R})$ is first category, as $f(\mathbb{R})=f(\mathbb{Q})\cup f(\mathbb{J})$. Consequently, we have $f(\mathbb{R})=\bigcup\limits_{i\in\mathbb{N}}{\{z_{i}\}}$.

But functions preserve unions in both ways, so

 $\mathbb{R}=f^{-1}(\bigcup\limits_{i\in\mathbb{N}}{\{z_{i}\}})=\bigcup\limits_{% i\in\mathbb{N}}{f^{-1}(\{z_{i}\})}.$ (1)

Now, $f$ is continuous, and as $\{z_{i}\}$ is closed for every $i\in\mathbb{N}$, so is $f^{-1}(\{z_{i}\})$. This means that $\overline{f^{-1}(\{z_{i}\})}=f^{-1}(\{z_{i}\})$. If $\operatorname{int}(f^{-1}(\{z_{i}\}))\neq\varnothing$, we have that there is an open interval $(a_{i},b_{i})\subseteq f^{-1}(\{z_{i}\})$, and this implies that there is an irrational number $x_{i}$ and a rational number   $y_{i}$ such that both lie in $f^{-1}(\{z_{i}\})$, which is not possible because this would imply that $f(x_{i})=f(y_{i})=z_{i}$, and then $f$ would map an irrational and a rational number to the same element  , but by hypothesis   $f(\mathbb{Q})\subseteq\mathbb{J}$ and $f(\mathbb{J})\subseteq\mathbb{Q}$.

Then, it must be $\operatorname{int}(f^{-1}(\{z_{i}\}))=\varnothing$ for every $i\in\mathbb{N}$, and this implies that $\mathbb{R}$ is first category (by (1)). This is absurd, by the Baire Category Theorem.

Title no continuous function switches the rational and the irrational numbers NoContinuousFunctionSwitchesTheRationalAndTheIrrationalNumbers 2013-03-22 14:59:15 2013-03-22 14:59:15 yark (2760) yark (2760) 13 yark (2760) Result msc 54E52