Let $f$ be a function defined on the closed interval $[0,1]$, such that $f(0)<f(1)$.
If for every $f(0)<b<f(1)$ there exists a $0<c<1$ such that $f(c)=b$
then $f(x)$ is continuous on the closed interval $[0,1]$.
I'm having trouble understanding why this is statement isn't true. Any idea to help me visualize it in some form will help a lot.
Thanks!
First example: $$f(x)=\begin{cases} 2x\quad\quad\ \ \ \text{ if }\quad 0\le x\lt\frac12,\\ 2x-1\quad\text{ if }\quad\frac12\le x\le1.\\ \end{cases}$$ Now $f(0)=0\lt1=f(1)$.
If $f(0)\lt b\lt f(1)$, then $0\lt\frac b2\lt\frac12\lt\frac{b+1}2\lt1$ and $f\left(\frac b2\right)=f\left(\frac{b+1}2\right)=b$,
but $f$ is discontinuous at $x=\frac12$.
Second example:
$f\left(\frac13\right)=\frac23$ and $f\left(\frac23\right)=\frac13$, while $f(x)=x$ in all other cases.
Third example:
$f(0)=0$ and $f(1)=1$, while $f(x)=1-x$ for $0\lt x\lt1$.
On the other hand, if $f$ is a weakly increasing function on $[0,1]$ (that is, $0\le x\lt y\le1$ implies $f(x)\le f(y)$), and if $f$ maps $[0,1]$ onto $[f(0),f(1)]$, then $f$ must indeed be continuous on $[0,1]$. This is probably what you were thinking of; it's true because monotone functions can have only jump discontinuities.