How can I show that a bijective continuous function $f:\mathbb R\to \mathbb R$ is monotone ?
My attempts
Let $a<b$. Since $f$ is injective, $f(a)\neq f(b)$. Therefore $f(a)<f(b)$ or $f(a)>f(b)$. Suppose with out loss of generality that $f(a)<f(b)$ and let $x,y\in[a,b]$ such that $x<y$. By injectivity, $f(x)\notin \{f(a),f(b)\}$. Suppose that $f(x)\notin ]f(a),f(b)[$.
If $f(x)<f(a)$, by the intermediate value theorem (IVT), there is a $c\in[x,b]$ such that $f(x)=f(c)$ what contradict injectivity.
If $f(x)>f(b)$, by IVT we have a $d\in[a,x]$ such that $f(d)=f(b)$ what also contradict injectivity.
Then $f(x)\in [f(a),f(b)]$. We can show as well that $f(y)\in [f(a),f(b)]$ and that $f(x)<f(y)$. Therefore we have that $f(x)<f(y)$ if $x<y$.
The problem is that I'm not sure that my proof is finish. I just proved that for all $a,b\in\mathbb R$, s.t. $a<b$ the function $f$ is monotone on $[a,b]$. But may be it's enough to say that it's monotone on all $\mathbb R$. What do you think ?