If $f:[a,b]\to\mathbb{R}$ is a continuous function and $f(x)\in\mathbb{Q}$ for all $x\in[a,b]$ then what can say about $f$?
My try: I think f should be constant, if it is not constant then it contradicts the continuity. Can anyone prove that f is constant?