TITLE: $f:\mathbb{R} \to \mathbb{R}$ continuous, locally 1-1 implies $f$ globally 1- 1
QUESTION [5 upvotes]: Suppose $f: \mathbb{R} \to \mathbb{R}$ is continuous, and locally 1-1. I want to show it is globally 1-1 (without assuming the existence of $f'$).
The intermediate value theorem implies that $f$ is locally strictly monotonic.  Intuitively, I would like to show that if $f(a)=f(b)$, then somewhere between $a$ and $b$, $\,f$ must "switch directions", but I haven't had any traction with this strategy.
Any ideas?

REPLY [2 votes]: You could prove the similar statement that a continuous function $f: \mathbb{R} \to \mathbb{R}$ is injective if and only if it has no local extrema. (If you're stuck, it's discussed here.)
Assuming that statement is true, then the result is easy. Indeed, if $f: \mathbb{R} \to \mathbb{R}$ is continuous but not injective, then $f$ has a local extrema at some $x_0$, and it follows (show this) that $f$ is not locally injective at $x_0$.
Edit: I didn't notice the comments before posting this. The solution there is similar but more to the point.