# Continuous function $f:\mathbb{R}\to\mathbb{R}$ that got no extrema must be one to one

I got this question:

Prove that if $f:\mathbb{R}\to\mathbb{R}$ is a continuous function that got no extrema then $f$ is one to one.

I tried to prove it but I don't know how to proceed. I started by assuming that $f$ is not one to one, and therefore we know that there exist $x_1,x_2\in \mathbb{R}$ such that $f(x_1)=f(x_2)$, how do I show that there exist a relative minimum or a relative maximum in $(x_1,x_2)$ which will contradict the assumption that $f$ got no extrema.

Note: don't use Rolle's theorem or derivatives since in my class I cannot use this theorems yet.

• Do you know the theorem that a continuous function on a closed interval has a maximum and a minimum? – egreg Apr 17 '14 at 14:37

You idea is very good: just invoke Weierstraß' theorem on the interval $[x_1,x_2]$.
• Probably because $f(x_1)=f(x_2)$: either a global maximum of global minimum (global w.r.t. $[x_1,x_2]$) must fall in $(x_1,x_2)$. – Siminore Apr 17 '14 at 14:44
• But how do you know that there is a global minimum or a global maximum in $(a,b)$? – MathNerd Apr 17 '14 at 15:21
• What is $(a,b)$? Anyway, Weierstraß' theorem provides the existence of maxima and minima in $[x_1,x_2]$. Unless $f$ is constant on this interval, at least one of them must lie in $(x_1,x_2)$. – Siminore Apr 17 '14 at 16:45