If $f'(x_0) \ne 0$, prove that there is an interval $(c,d)$ containing $x_0$ such that $f$ is one to one on $(c,d)$. Suppose that $f:(a,b)\to\mathbb{R}$ has a continuous derivative on $(a,b)$. If $f'(x_0) \ne 0$, prove that there is an interval $(c,d)$ containing $x_0$ such that $f$ is ont to one on $(c,d)$.
My solution:
Suppose f is not one to one on $(c,d)$. If we define $(x,y)$ to be an open interval in $(c,d)$. By Rolle's theorem, there exists $z \in (a,b)$ such that $f'(z) \ne 0$ so z cannot be in that interval. which is a contradiction.
The ending feels weak, any suggestions?
Thanks
 A: You have to use that $f'$ is continuous. This means that there is some $\delta >0$ where $x\in (x_0-\delta,x_0+\delta)=I_\delta \implies f'(x)>0$ or $f'(x)<0$ always. What does this tell you about the behaviour of $f$ in such interval? You can in fact use MVT here, since if  $x<y\in I_\delta$ then $$\frac{f(y)-f(x)}{y-x}=f'(t)>0\; ;\; <0 $$ for some $t\in I_\delta$. Since $y-x>0$, what can you say about $f(y)-f(x)$?
A: $1$. Consider a small interval around $x_0$ so that $f'(x_0)$ doesn't change sign. (Why is this possible?)
$2$. If $f'$ does not change sign in an interval, can you say that $f$ is strictly monotone?
$3$. Are strictly monotone functions one-to-one?
I trust you can fill in the details.
A: More interestingly, one cannot remove the assumption that $f'$ is continuous in a neighborhood of $x_0$. For example, consider 
$$ f(x)=\left\{\begin{array}{lc}x/2+x^2\sin(1/x)&\mbox{ if }x\ne0,\\0&\mbox{ if }x=0.\end{array}\right. $$
Then $f'$ exists everywhere, but is discontinuous at $0$. We have that $f'(0)=1/2>0$, and $f$ is not one-to-one in any neighborhood of zero. The reason is that $$f'(x)=\frac12+2x\sin\frac1x-\cos\frac1x$$ for $x\ne0$, so near zero $f'$ oscillates from positive to negative, so $f$ increases and decreases infinitely often.
