3

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?

user26857
  • 53,190
Flip
  • 828

2 Answers2

7

We proceed by contradiction: Assume that

$$\begin{cases}a\le x,y\le b \\f(x)\ne f(y)\end{cases}$$

WLOG assume $f(x)<f(y)$ (if not: switch their labels). Then by the intermediate value theorem, $f$ takes all values in the interval $[f(x),f(y)]$. Since there are infinitely many irrationals between any two real numbers, $f$ takes on an irrational value: a contradiction. So $f$ is constant.

Adam Hughes
  • 37,795
  • 10
  • 61
  • 85
3

Suppose if f is not constant then there are x and y in [a,b] such that $f(x)\not=f(y)$ then it also takes any value between f(x) and f(y) at some point in [x,y].Which is contradiction to $f(x)\in\mathbb{Q}$ for all $x\in[a,b]$

Flip
  • 828