I have been attempting to do the following question by contradiction. However, I just got stuck at where to use the given continuity condition. It would be really appreciated if you can possibly give a further hint to solving this problem.
Here it goes
Let $f(x):\mathbb{R} \rightarrow \mathbb{Q}$ is a continuous function. Prove that $f$ is a constant.