Prove that if $f:[a,b]\to\Bbb{R}$ is one to one and has the intermediate value property, then $f$ is strictly monotone I got this problem:
Prove that if $f:[a,b]\to\Bbb{R}$ is one to one and has the intermediate value  property, then $f$ is strictly monotone.
That is, we must show that $\forall x,y\in[a,b], x<y \to f(x)<f(y)$ or $\forall x,y\in[a,b], x<y \to f(x)>f(y)$.
Start of my proof: 
Suppose not. 
That is suppose that $\exists x_1,y_1\in[a,b], x_1<y_1 \,\,and\,\, f(x_1)\geq f(y_1)$ and suppose that $\exists x_2,y_2\in[a,b], x_2<y_2 \,\,and\,\,\, f(x_2)\leq f(y_2)$.
Now since $f$ is one to one we get that $\exists x_1,y_1\in[a,b], x_1<y_1 \,\,\,and f(x_1)> f(y_1)$ and that $\exists x_2,y_2\in[a,b], x_2<y_2 \,\,and \,\,\,f(x_2)< f(y_2)$.
Now I am not sure how to split the proof into cases?
Thanks on any hints.
 A: Hint : if $f$ is not monotone, then there is a "saddle" point, i.e. $x_1<x_2<x_3$ such that $f(x_1)<f(x_2)>f(x_3)$ or $f(x_1)>f(x_2)<f(x_3)$.
Indeed, suppose for example that $f(a)<f(b)$ (replace $f$ with $-f$ otherwise). If $f$ is not increasing on $(a,b)$, there are $u<v$ in $[a,b]$ with $f(u)>f(v)$. 
If $f(a)<f(u)$, we can take $x_1=a,x_2=u,x_3=v$.
If $f(b)>f(u)$, we can take $x_1=u,x_2=v,x_3=b$.
If none of those two inequalties hold, we have $f(a)>f(u)>f(v)>f(b)$ contradicting the initial hypothesis. 
A: There is no reason to ever consider $f(x_1)=f(x_2)$ for different $x$'s since the function is one-to-one. So only strict inequalities are needed!
If $f$ is not strictly monotone we may find $x_1<x_2<x_3$ (WLOG since otherwise we could just consider $g=-f$) such that
$$
f(x_2)>f(x_1),f(x_3)
$$
But then by the intermediate value property we must have $c_1\in[x_1,x_2]$ and $c_2\in[x_2,x_3]$ with $f(c_1)=f(c_2)$ which contradicts $f$ being one-to-one.
A: I'll show that if $f$ is one to one and not monotone in $[a,b]$ then there exist $x_1,x_2,x_3\in[a,b]$ such that $x_1<x_2<x_3$ and $f(x_2)<f(x_1),f(x_3)$ or $f(x_1),f(x_3)<f(x_2)$:
(Note: I tried to write the proof similiar to nested if statements in computer programming for better flow)

Since $f$ is one to one we get that $f(a)\neq f(b)$ and hence there are two cases $f(a)<f(b)$ or $f(a)>f(b)$
if $f(a)<f(b)$ then:
Since $f$ is not monotone, we get that in particualr $f$ is not decreasing and so there exists $u,v\in[a,b]$ such that $f(u)>f(v)$ (because $f$ is one to one, there cannot be equalty).
Now there two cases $u=a$ or $u\neq a$:
if $u=a$ then:
Since $u<v$ we get that $a<v$ and that $f(a)>f(v)$
Now we'll prove that $v\neq b$:
If $v = b$ we get that $f(a)>f(b)$ which contradicts the fact that $f(a)<f(b)$, And so $v\neq b$ and hence we get that $v\in(a,b)$.
Now since $f(a)>f(v)$ and since $f(b)>f(a)$ we get that $f(v)<f(a),f(b)$.
Now set $x_1 = a, x_2 = v, x_3=b$ and we get that $x_1<x_2<x_3$ and that $f(x_2)<f(x_1),f(x_3)$.
if $u\neq a$ then:
Now we'll show that $u\neq b$ because if $u = b$ we get that $b=u<v$ and so $v\notin [a,b]$ which is a contradiction and so $u\in(a,b)$.
Now there are two cases: $v=b$ or $v\neq b$
if $v=b$ then:
We get that $f(u)>f(b)$ and since $f(b)>f(a)$ we get that $f(a),f(b)<f(u)$
and since $u\in(a,b)$ we get that $a<u<b$.
Now set $x_1 = a, x_2 = u, x_3=b$ and we get that $x_1<x_2<x_3$ and that $f(x_1),f(x_3)<f(x_2)$.
if $v\neq b$ then:
We'll show that $v\in(a,b)$:
Since $v\in[a,b]$ we get that $v\leq b$ but since $v\neq b$ we got that $v<b$. Now since $a<u<v$ we get that that $a<u$ and so $v\in(a,b)$. 
and we got $a<u<v<b$.
Now there are two cases: $f(a)<f(u)$ or $f(b)>f(v)$
Because if  $f(a)>f(u)$ and $f(b)<f(v)$ and since $f(u)>f(v)$ we get that $f(a)>f(u)>f(v)>f(b)$ and so $f(a)>f(b)$ which is a contradiction.
if $f(a)<f(u)$ then: 
Take $x_1=a,x_2=u,x_3=v$ and we get that $x_1<x_2<x_3$ and since $f(u)>f(a),f(v)$ we get $f(x_1),f(x_3)<f(x_2)$.
if $f(b)>f(v)$ then: 
Take $x_1 = u, x_2=v,x_3=b$ and we get that $x_1<x_2<x_3$ and since $f(b),f(u)>f(v)$ we get $f(x_2)<f(x_1),f(x_3)$.

Similarly we prove for the case $f(a)>f(b)$.
A: Edit: Suppose your function is not monotone, then there are four points such that $y_1<y_2$
and $y_3<y_4$ and $f(y_1)<f(y_2)$ and $f(y_4)<f(y_3)$. So we can take three of these four points and organize then in a increasing order 
$x_1<x_2<x_3$ such that  $f(x_1)< f(x_3)<f(x_2)$, $f(x_2)< f(x_1)<f(x_3)$, $f(x_2)< f(x_3)<f(x_1)$,  or $f(x_3)< f(x_1)<f(x_2)$, since $f$ is one to one, the values of $f(x_i)\,\,\,i=1,2,3$ can not be the same, suppose the first case, the others are similar. Since your function has the property of the intermidiate value, we have that  exists   $x_4\in (x_1,x_2)$ such that $f(x_4)=f(x_3)$ what is a contradiction, since the function is one to one. The same argument is valid for the others cases.
