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?