8

I'm self studying, and I was wondering if there were anything else that could be said about the following:

Suppose that $f$ is continuous on $[a,b]$ and that $f(x)$ is always rational. What can be said about $f$?

I said that $f$ could be a constant function, where $f$ equals a rational number $c$. From this, I said that it is then bounded above and below, and achieves a maximum and minimum value.

I was wondering if $f(x)$ could be a function that is not constant and is still continuous?

  • 5
    hint: IVT ${};$ –  Apr 01 '15 at 22:00
  • intuitively it can be only constant because the set of rationals is countable – Alex Apr 01 '15 at 22:03
  • @RickyDemer is right, and IVT stands for "Intermediate Value Theorem." – Rory Daulton Apr 01 '15 at 22:03
  • @dragon : That doesn't do it. That set of all real numbers is dense and yet we don't get the same conclusion. On the other hand, the set of integers is not dense and we do get the same conclusion for those. ${}\qquad{}$ – Michael Hardy Apr 01 '15 at 22:10
  • 1
    @dragon : The denseness of $\mathbb Q$ within $\mathbb R$ does not mean that between any two rationals there is an irrational number; rather it means that between any two real numbers there is a rational number. ${}\qquad{}$ – Michael Hardy Apr 01 '15 at 22:11
  • @MichaelHardy Then does the density of $\mathbb{R} \setminus \mathbb{Q}$ say there is a rational number between two irrational numbers? – Cookie Apr 01 '15 at 22:12
  • No. It means between every two real numbers there is an irrational number. ${}\qquad{}$ – Michael Hardy Apr 01 '15 at 22:13
  • Notice that between any two integers there is an irrational number, but the set of all integers is not dense in $\mathbb R$. ${}\qquad{}$ – Michael Hardy Apr 01 '15 at 22:13
  • @dragon something being dense tells you there are "lots" of them, but your conclusions are saying there are lots of things in the complement, which doesn't fit. – James Apr 01 '15 at 22:14

2 Answers2

10

If $f$ is not constant, then it has values $f(x_1)\ne f(x_2)$. The intermediate value theorem then says it attains all values between $f(x_1)$ and $f(x_2)$. So the problem is only to show that there must be some irrational number between $f(x_1)$ and $f(x_2)$. Has Spivak posed an earlier exercise asking you to prove that between any two real numbers there is some irrational number?

5

If you assume it's not constant then the function takes two values A and B such that $f(a)=A < f(b)=B$. Then as it's continuous, it must take all values C which are between A and B. But between any two rationals there are infinitely many rationals but also infinitely many irrationals. So the function must take these irrational values which is a contradiction.

peter.petrov
  • 12,568