Show $f$ is a constant function. 
Let $f:[0,1]\rightarrow\mathbb{R}$ is continuous and $f([0,1])\subseteq\mathbb{Q}$. Show $f$ is a constant function. 


Assume that $f$ is not a constant function, then there exists $a,b\in[0,1]$ such that $f(a)< f(b)$ and $f(a),f(b)\in \mathbb{Q}$. Then apply the Intermediate Value Theorem, there exists a $c$ such that $f(a)< c< f(b)$, where $c\in\mathbb{R}$. We know that $\mathbb{R}-\mathbb{Q}$ is dense of $\mathbb{R}$, $c$ is possible be an irrational number which is a contradiction. 

Can anyone give me a hit or suggestion to write a direct proof ? Thanks in advanced.
 A: Hint: the image of f must be an interval
A: Say that $[0,1]$ is connected and, as $f$ is continuous, $f([0,1])$ is connected : connected sets of $\mathbb{Q}$ are singletons, and you get your result.  
A: $f$ is a continuous function, so the image of compact sets is compact and the image of connected sets are connected.
$[0,1]$ is compact and connected, therefore $f([0,1])$ is compact and connected.
The only connected subsets of $\mathbb{R}$ are intervals.
That gives us that $f([0,1])$ needs to be a compact interval.
Therefore $f([0,1])=[a,b]$ for some $a \leq b$.
That tells us that $a =b \in \mathbb{Q}$ since between every two numbers there is an irrational number between them.
A: If we assume that two different rational numbers $q_1,q_2$ belong to the range of $f$, say $f(x_1)=q_1,f(x_2)=q_2$, then
$$z=\frac{q_1\sqrt{2}+q_2\sqrt{3}}{\sqrt{2}+\sqrt{3}}$$
belongs to $f\left([x_1,x_2]\right)$ by the intermediate value theorem. However, $z$ cannot be a rational number, because that would imply $\sqrt{\frac{3}{2}}\in\mathbb{Q}$, hence the range of $f$ is a singleton.
