# constant function question

• Oct 31st 2009, 07:18 PM
dannyboycurtis
constant function question
Hi I am having trouble with a proof, was wondering if someone could give me some insight...
Here is the problem:
Suppose f:[a,b] --> Q is continuous on [a,b]. Prove that f is constant on [a,b].

I did a proof by contradiction, but realized that nowhere in my proof was there anything about Q, which Im sure is the crux of the issue.
Any insight into how to prove this using contradiction?
My contradiction was to assume that for some x,y existing in [a,b], f(x) does not equal f(y)....
• Oct 31st 2009, 09:41 PM
Failure
Quote:

Originally Posted by dannyboycurtis
Hi I am having trouble with a proof, was wondering if someone could give me some insight...
Here is the problem:
Suppose f:[a,b] --> Q is continuous on [a,b]. Prove that f is constant on [a,b].

I did a proof by contradiction, but realized that nowhere in my proof was there anything about Q, which Im sure is the crux of the issue.
Any insight into how to prove this using contradiction?
My contradiction was to assume that for some x,y existing in [a,b], f(x) does not equal f(y)....

Do you know the intermadiate value theorem? I assume that your Q stands for the set of rational numbers $\mathbb{Q}$, i.e. f can only assume rational values. If so, consider this: if $f(x_1)\neq f(x_2)$ for some $x_{1,2}\in [a,b]$, then, by the intermediate value theorem, for any non-rational (irrational) $y$ between $f(x_1)$ and $f(x_2)$ there must exist an $x_3$ between $x_1$ and $x_2$ such that $f(x_3)=y$. But since $y\notin \mathbb{Q}$, and the codomain of f is $\mathbb{Q}$ we have a contradiction. (The point, of course, is that between any two rational numbers there lies a non-rational (irrational) number.)
• Oct 31st 2009, 10:59 PM
dannyboycurtis
so simple, I cant believe I overlooked it. Thanks a lot!
• Nov 4th 2009, 01:47 PM
scherz0
Hello there,

I just want to make sure that the above proof by contradiction is based on the assumption that $f(x)$ is NOT a constant function $\Rightarrow f(x) \neq f(y)$.

Then the density of irrational numbers in the set of rational numbers would provide the contradiction as needed.

Thank you!