# Cases when the intermediate value theorem is true

Consider the intermediate value theorem. It says that a continuous function $f(x)$ on a closed interval $[a,b]$ takes on every value between $f(a)$ and $f(b)$ at least once. Excluding trivialities like $f(x)=\mbox{constant}$, my question is how often can $f(x)$ achieve an intermediate value and still be continuous on $[a,b]$? For any finite number, a continuous function can always be constructed, like sine with a high enough frequency. But is it possible that an intermediate value is achieved by $f(x)$ an infinite number of times? Countable, uncountable number of times?

So looking for a continuous function $f(x)$ on a closed interval $[a,b]$ with $f(a)\neq f(b)$ such that for some $z$ between $f(a)$ and $f(b)$, there exist infinitely many values $c$ in $[a,b]$ for which $f(c)=z$. If such a function is not possible, then perhaps an intuitive argument of its impossibility will help.

-
Exactly which functions "like f(x)=constant" do you want to exclude? –  Chris Eagle Oct 29 '12 at 21:54
Countably infinitely many $c$ with $f(c)=z$ is certainly possible. What do you think happens with uncountably many? –  Andres Caicedo Oct 29 '12 at 22:04
Haha, I should have taken the extra ten second to think this through Andres. So uncountably many isn't possible because either the function will be a constant or discontinuous, right? –  Fixed Point Oct 29 '12 at 22:28
–  M. Strochyk Oct 29 '12 at 22:43
Not an answer to the question - but for a radically discontinuous function satisfying the Intermediate Value Theorem you should investigate the Conway Base 13 Function. –  Mark Bennet Oct 29 '12 at 22:48
show 1 more comment

You can use a non-analitic function... for instance $f(x)=x-1$ $\forall x \in [0,1]$, $f(x)=0$ $\forall x \in [1,2]$ and $f(x)=x-2$ $\forall x \in [2,3]$.
If you think only about analitic functions, well...I can answer using complex analysis. Look here http://www.math.unipd.it/~parsifal/MathematicalMethods/MathematicalMethods.pdf page 32. As you see if there are infinite zeroes then you have the null function so you can't have a function with infinite zeroes because $[a,b]$ is a compact and every infinite subset has an accumulation point.
(Wrote this before your edit.) Given $a<b$, $c<e<d$, and any $n$, you can find an analytic function such that $f(a)=c$, $f(b)=d$ and $f(z)=e$ has at least $n$ solutions. You cannot replace $n$ with "infinitely many", as the zeros of analytic functions are isolated. –  Andres Caicedo Oct 29 '12 at 22:24
If a function is constant on a sub-interval of $[a,b]$ then it takes that value for uncountably many arguments. –  copper.hat Oct 29 '12 at 23:26