TITLE: Let $f:[1,10]\to \Bbb{Q}$ be a continuous function and $f(1)=10,$then $f(10)=?$
QUESTION [8 upvotes]: Let $f:[1,10]\to \Bbb{Q}$ be a continuous function and $f(1)=10,$then $f(10)=?$
$(A)\frac{1}{10}\hspace{1 cm}(B)10\hspace{1 cm}(C)1\hspace{1 cm}(D)$cant be obtained
I could not solve this question.I thought over it for many minutes,here $\Bbb{Q}$ is a set of rational numbers.If $f(1)$ is known,can we find $f(10)$?I suspect,Calculus has something to do in the solution.Can someone please help me in this question?

REPLY [13 votes]: Suppose $f(10) = a \neq 10$ where $a$ is a rational. Then by the IVT, every real number between $a$ and $10$ is attained by the function in the interval $[1, 10]$. (Also, if we are strict since IVT usually requires real functions, we are using a generalization of IVT: continuous functions preserve connectedness.)
Now between every 2 distinct rationals, there is an irrational. So the function must have an irrational number in its image. But the codomain of the function is the rational numbers, so this is a contradiction. Hence $f(10) = 10$.
Credit to the comment above.