Let $\displaystyle f: \mathbb{R}\rightarrow \mathbb{R}$ be a continuous function such that $\displaystyle f(x)$ is a rational number for every real input $\displaystyle x$. Show that$\displaystyle f$ must be a constant function.

Heres what I have:

Let $\displaystyle x$ be any real number. There must exist a sequence of rational numbers $\displaystyle \{r_n\}\rightarrow x$. Since $\displaystyle f$ is continuous, we can conclude that $\displaystyle f(x)=\lim_{x\to c}(r_n)=c$.

Im iffy on my last sentence and am thinking there could be a better way to do this using the EVT?