I would like to prove the following: "If $f$ is a differentiable function on an open interval and has no local extremum, then $f$ is monotone."
I have seen some questions that asks the same thing in this website, but the answers didn't seem clear to me. Also, since the differentiability condition is given, I would like to make use of it to prove the proposition.
Thank you.
Suppose $f$ is not monotone on the interval $(a,b)$. Since it isn't nondecreasing, there are $c_1,c_2$ in that interval with $c_1 < c_2$ and $f(c_1) > f(c_2)$. By the Mean Value Theorem, there is $c$ in the interval with $$f'(c) = \dfrac{f(c_2)-f(c_1)}{c_2 - c_1} < 0$$ Similarly, since it isn't nonincreasing, there is $d$ in the interval with $f'(d) > 0$.
Case 1: $c < d$.
Since $f$ is continuous on $[c,d]$, it attains a minimum on the interval $[c,d]$. That minimum can't be at $c$ because $f'(c) < 0$, and can't be at $d$ because $f'(d) > 0$, so it must be at some point $e$ with $c < e < d$. Then $e$ is a local maximum of $f$.
Case 2: $d < c$.
By a similar argument, the maximum of $f$ on the interval $[d,c]$ must be at some $e$ with $d < e < c$, and this is a local maximum of $f$.