Let $f : \mathbb R \to \mathbb R$ continuous without local extremas. Show that $f$ is monotonic.
Here is my attempt, proving the contraposition :
If $f$ is not monotonic then $\exists a < b < c \text{ such that } f(a) < f(b) \text{ and } f(b) > f(c)$ (or reverse sense).
Then I do not know what is the next right thing to say : maybe "since $f$ is continuous it admits a local extrema."
What do you think is the right thing to say to finish this proof ? Or maybe there is a direct proof you can give me ?
This is more or less a direct application of the extreme value theorem :
First notice that constant functions have local extrema everywhere, so $f$ cannot be constant, nor locally constant for that matter.
Now suppose there exists $(a,b)\in\mathbb R^2$ such that $f(a)=f(b)$, since $f$ is not locally constant, there also exists $c\in(a,b)$ such that $f(a)\neq f(c)$.
By the extreme value theorem for $f$ continuous on interval $[a,b]$, $f$ reaches a min and a max on $[a,b]$, but since $f(c)$ is distinct from $f(a),f(b)$ then these cannot be both $a$ and $b$, so either a min or a max exists on an interior point of $(a,b)$.
This contradicts the hypothesis that $f$ has no local extremum, therefore $f$ must be injective (i.e. refutation of $\exists\ f(a)=f(b)$).
We conclude invoking the equivalence between strictly monotonic functions and continuous injective functions.