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.