# Intermediate Value Theorem for Rationals

I was thinking about this. My intuition is that there is a counterexample. Suppose $f:[0,1]\longrightarrow \mathbb{R}$ is continuous. Also suppose

1. If $q\in\mathbb{Q}$, then $f(q)\in\mathbb{Q}$.
2. $f(0)<0$
3. $f(1)>1$

By the Intermediate Value Theorem, for any rational number $r$ with $0<r<1$ there is an $x$ with $0<x<1$ such that $f(x)=r$. Is this true of the restriction $f:\mathbb{Q}\longrightarrow\mathbb{Q}$.

-
I can't figure out why enumerate won't work. –  Joe Johnson 126 Dec 8 '12 at 0:23
I don't get whats in the box –  Amr Dec 8 '12 at 0:23
@JoeJohnson126: edited. –  Sigur Dec 8 '12 at 0:29
Your intuition is correct. For an ordered field, the Intermediate Value Property is equivalent to completeness. –  lhf Dec 8 '12 at 1:13
@Sigur Thanks for the edit. –  Joe Johnson 126 Dec 8 '12 at 14:38

$$f(q) = 3 q^2 - 1 {}{}{}{}{}{}{}$$