The problem asks as, whether there exists a continuous function $f: \Bbb{R} \rightarrow \Bbb{R}$ an image of which is set:

* $[0,1)$
* $(0,1]\cup[2,3]$
* $\Bbb{Q}$

So - for $[0,1)$ you can see that you can create function $f$ for which $\lim\_{x\rightarrow +\infty} f(x) = 1$, and from $-\infty$ to some finite number it is constant $f(x)=0$ and than you can make a "smooth", parabolic transition between $0$ and $1$. For the second and third set you kinda see that it's not possible, as there is a gap between every rational number and between $1$ and $2$. But how to prove such things formally?