$f : \mathbb{R} \to \mathbb{R}$ is continous function taking on values in $\mathbb{Z}$ or $\mathbb{Q}$. Show that it is constant function
Assume $f$ is not constant function.
Assume $f(c_1),f(c_2)$ such that both are rational (not equal to each other) . By density property of reals, a irrational number (say $r$) can be found in between them. By Intermediate value property , let $c$ be value on which $f(c)=r$. This is contradiction.
I am kind of stuck