# Math Help - continuous functions

1. ## continuous functions

If f: [0,1] is continuous and has only rational [respectively, irrational] values, must f be constant? Prove your answer.

2. does anyone have any idea how to do this??

3. Originally Posted by rmpatel5
If f: [0,1] is continuous and has only rational [respectively, irrational] values, must f be constant? Prove your answer.
Let’s assume $\left( {\forall x \in \left[ {0,1} \right]} \right)\left[ {f(x) \in \mathbb{Q}} \right]$ and suppose that $\left( {\exists \left\{ {a,b} \right\} \subseteq \left[ {0,1} \right]} \right)\left[ {f(a) \ne f(b)} \right]$.
Because the irrationals are dense there is an irrational number $\gamma$ between $f(a)\;\&\; f(b)$ but by the intermediate value theorem we know that ${\exists c}$ between $a\;\&\; b$ such that $f(c)=\gamma$.
How does that imply the $f$ is constant?

4. Originally Posted by Plato
Let’s assume $\left( {\forall x \in \left[ {0,1} \right]} \right)\left[ {f(x) \in \mathbb{Q}} \right]$ and suppose that $\left( {\exists \left\{ {a,b} \right\} \subseteq \left[ {0,1} \right]} \right)\left[ {f(a) \ne f(b)} \right]$.
Because the irrationals are dense there is an irrational number $\gamma$ between $f(a)\;\&\; f(b)$ but by the intermediate value theorem we know that ${\exists c}$ between $a\;\&\; b$ such that $f(c)=\gamma$.
How does that imply the $f$ is constant?