# Modified Intermediate Theorem Implies Continuity… Counterexample to Question from Spivak

Question 13b of chapter 7 in Spivak's Calculus (which I've been slowly working through over the last few months) says this:

'Suppose that f satisfies the conclusion of the Intermediate Value Theorem, and that f takes on each value only once. Prove that f is continuous.'

What I think he means by this is that if, for some $f$ defined on [a,b] and for all $u$, if $f(a)\leq u \leq f(b)$, then there is one and only one $c$ in $[a,b]$ such that $f(c) = u$. If this is true then $f$ is continuous.

I spent a few minutes trying to prove this, but in the end created a 'counterexample'. Right now I'm just wondering where I've gone wrong...

$$f(x) = \begin{cases} x+\frac{1}{2} & \text{if } 0 \leq x \leq\frac{1}{2} \\ 1-x & \text{if } \frac{1}{2} < x \leq 1 \end{cases}$$

$f$ is not continuous on $[0,1]$ but the IVT definitely holds over this interval and, furthermore, there's a 1-1 correspondence between $x$ values and $f(x)$ values over this interval.

Where have I gone wrong???

Thanks

-
The intermediate value property in the following sense doesn't hold: $f(1/4)=3/4, f(3/4)=1/4$ but at no $x\in [1/4,3/4]$ does one have $f(x)=5/8$, although $5/8\in [1/4,3/4]$. But +1 for your dynamic way of studying. –  Georges Elencwajg Feb 18 '12 at 8:55

I think this may be a question of interpretation. Your example is correct with the interpretation you are usng: your function $f$ takes every value in $[0,1]$ exactly once, but is not continuous on $[0,1].$ But one possible interpetation of what Spivak meant is that whenever $a < c < d < b$, $f$ takes each value between $f(c)$ and $f(d)$ exactly once on $[c,d]$, and then your example would not be a counterexample to the continuity of such an $f.$

-
I have to admit, this is exactly what I expected. To me, Spivak isn't particularly clear on which interpretation is correct, and then looking this up on Wikipedia I found they agreed with the definition I gave above. It's interesting how the 2 definitions are ever so slightly inconsistent :) –  tom Feb 19 '12 at 3:56

Note that $f(1/4)=3/4$ and $f(3/4)=1/4$. Certainly $1/2$ is between $f(1/4)$ and $f(3/4)$. But there is no $x$ between $1/4$ and $3/4$ at which $f(x)=1/2$. So your $f$ does not satisfy the Intermediate Value Theorem.

The IVT says that if $f$ is continuous on $[a,b]$, then for any $u$ and $v$ such that $a \le u \le v\le b$, and any $y$ between $f(u)$ and $f(v)$, there is an $x$ between $u$ and $v$ such that $f(x)=y$. The conclusion of the IVT is the part after the "then."

Remark: A somewhat simpler example of the type you described is given by $f(x)=x$ on $(0,1)$, $f(1)=0$, $f(0)=1$. Again, it does not satisfy the IVT.

Question $13$(b) can be attacked as follows. Suppose that $a \le x <b$. Imagine a sequence $x_1,x_2, \dots$ that approaches $x$ steadily from the right. If the $f(x_i)$ ever wiggle, the conclusion of the IVT quickly lets us contradict the "each value only once" condition. If the $f(x_i)$ form a monotone sequence, but this sequence does not approach $f(x)$, again we can use the conclusion of the IVT and the only once condition to get a contradiction.

-
Between $1/2-\varepsilon$ and $1/2+\varepsilon$ there is no point where the value of the function is $3/4$, even though $3/4$ is between the values of $f$ at those points (provided $\varepsilon$ is small enough). Hence the conclusion of the IVT is not satisfied by this function.
A hint: Looking at various graphs one is lead to conjecture that a function satisfying the IVT and taking any value at most once is strictly increasing or strictly decreasing. Therefore it is a good strategy to begin by proving that the given $f$ is strictly monotone. In this way the set of $f$'s to be considered for the continuity proof gets decisively restricted.