A continuous function with rational values is constant
Statement
Let be continuous and suppose is rational for every . Prove that is constant.
Hint
Argue by contradiction. If , what does the intermediate value theorem say about the values between them?
Show solutionHide solution
Solution
Idea. A continuous function cannot skip any value between two of its values. But the rational numbers have gaps: between two rationals there are irrational numbers.
Proof. Suppose for some , say . The interval contains an irrational number (for example , which lies strictly between since , and is irrational because is a non-zero rational).
By the intermediate value theorem on the interval between and , there is with . But is rational and is not. Contradiction.
Conclusion. for all , so is constant.
Remark. The same argument shows that a continuous function with values in is constant, and more generally that a continuous function on an interval cannot take only values in a countable set unless it is constant.