Continuous injective map is strictly monotonic

Let $M:=\{(x,y)|x<y\}$. Define $g\colon M\to \mathbb R$ by $g(x,y):=f(x)-f(y)$. Clearly $g$ is continuos and $M$ is connected. Hence $g(M)$ is connected, i.e., an interval of $\mathbb R$ which does not contain $0$ as $f$ is injective. That is, $g$ is either strictly negative or strictly positive, hence $f$ is strictly increasing resp. decreasing.


Let $x,y,z$ be real numbers with $x<y<z$. If $f(y)=\max\{f(x),f(y),f(z)\}$, then by injectivity $f(y)>f(x)$ and $f(y)>f(z)$. Let $\eta=\frac{f(y)+\max\{f(x),f(z)\}}2$. Then $f(x)<\eta<f(y)$, hence by the IVT there exists $\xi_1\in(x,y)$ with $f(\xi_1)=\eta$. Also, $f(y)>\eta>f(z)$, hence by the IVT, there exists $\xi_2\in(y,z)$ with $f(\xi_2)=\eta$. Clearly,m $\xi_1\ne \xi_2$, hence we have a contradiction to injectivity of $f$. We conclude that $f(y)\ne\max\{f(x),f(y),f(z)\}$. Similarly, $f(y)\ne\min\{f(x),f(y),f(z)\}$. Thus we either have $f(x)<f(y)<f(z)$ or $f(x)>f(y)>f(z)$.

Then for any finite sequence $x_1<x_2<\ldots <x_n$ we have either $f(x_1)<f(x_2)<\ldots < f(x_n)$ or $f(x_1)>f(x_2)>\ldots > f(x_n)$. Now for any two numbers $x_1<x_2$, sort $\{0,1,x_1,x_2\}$ into ascending order and thus conclude that $f(x_1)<f(x_2)\iff f(0)<f(1)$.