4

True or false: There exists a continuous function $f: \Bbb R \to \Bbb R$ such that $f(\Bbb Q) \subseteq {\Bbb R}\setminus {\Bbb Q}$ and $f({\Bbb R}\setminus {\Bbb Q}) \subseteq {\Bbb Q}$.

My attempt: I was trying to use the sequential definition of continuity. Consider $a \in \Bbb R$ then we have a seqn ${x_n}$ of rational numbers converging to $a$ and we have a seqn ${y_n}$ of irrational numbers converging to $a$. Then what will be $f(a)$? I was thinking that in one way $f(a) \in \Bbb Q$ and on the other way $ f(a) \in {\Bbb R}\setminus {\Bbb Q}$ . But I am wrong $\{f(x_n)\} \subseteq {\Bbb R}\setminus {\Bbb Q}$ and $\{f(y_n)\} \subseteq {\Bbb Q}$ still $f(a)$ can be anywhere.

Is there any way to fix my attempt or any other possible idea?

Ri-Li
  • 9,466
  • 4
  • 56
  • 104
  • 2
    Hint: suppose $f$ is nonconstant, and let $a,b$ be two of its values. Then $f$ should take uncountably many irrational values between $a,b$. – Wojowu Jun 16 '19 at 22:11
  • @Wojowu In fact you don't have to suppose $f$ is nonconstant, it is a consequence of the assumptions. – Jürgen Sukumaran Jun 16 '19 at 22:14
  • @TonyS.F. My argument would require considering two cases, constant vs nonconstant. The former is immediate though. – Wojowu Jun 16 '19 at 22:20

1 Answers1

6

There is a nice proof of this fact, which doesn't use cardinality. Assume such $f:\Bbb R\to \Bbb R$ exists. You can do two modifications to $f$ which wont change the property that $f(\Bbb Q) \subseteq {\Bbb R}\setminus {\Bbb Q}$ and $f({\Bbb R}\setminus {\Bbb Q}) \subseteq {\Bbb Q}$:

  • You can add a rationnal number to $f$, i.e take $\tilde{f}$ defined by $\tilde{f}(x)=f(x)+p/q$.

  • You can multiply $f$ by a rational number, i.e take $\tilde{f}$ defined by $\tilde{f}(x)=(p/q)\times f(x)$.

Now define $g=f\vert_{[0,1]}$. Then $g$ is continuous and bounded. By adding a "big" rational number to $f$ you can assume $g\geq 0$. By multiplying $f$ by a "small" positive rational number you can also assume $g\leq 1$. Finally you have found $g:[0,1]\to [0,1]$ which is continuous and send rational numbers to irrational and conversely. But this is not possible, as $g$ must have a fixed point.