How to show that a real continous function with image in the rationals is constant?

103 Views Asked by At

Can someone please explain to me how I am supposed to approach this question:

If $f: [0,1] \to \mathbb{ R}$ is continuous, and has only rational values, then $f$ must be a constant.

3

There are 3 best solutions below

3
On

Hint: a continuous image of a connected space should be connected.

3
On

Hint: Suppose $f$ takes on two values $a,b\in\mathbb{Q}$ for which $a\neq b$. What does the intermediate value theorem tell us?

0
On

Let $\mathbf{I}$ be the interval $[0,1]$. Since $f$ is continous on the inverval $\mathbf{I}$, then $f(\mathbf{I})$ must be an interval. Now, suppose that $f(\mathbf{I})$ is the interval $[a,b]$, where a, b $\in$ $\mathbb{Q}$. Since irrationals are dense, we can find a irrational number in the interval $[a,b]$. This is a contradiction because we know that $f(\mathbf{I})$ $\subset$ $\mathbb{Q}$. Then $f(\mathbf{I})$ must be a degenerated inverval and therefore it takes a constant value.