Prove if a continuous function $f$ is one-to-one, it is monotonic. This is the converse of Prove that if function f is monotonic, then it is one-to-one. Let $f \colon (a,b) \to \mathbb{R}$ be a continuous function. Prove that if $f$ is one-to-one in $(a,b)$, then $f$ is monotonic.
What I am thinking is assume by contradiction that if $f$ is not monotonic, there exists $x_1, x_2, x_3, x_4$ s.t. $x_1 \le x_2, f(x_1) \le f(x_2), x_3 \le x_4, f(x_3) \ge f(x_4)$. Try to find two points $y_1,y_2$ where $f(y_1) = f(y_2)$. However I find the there are too many cases need to be considered for example the order of $x_1,x_2,x_3, x_4$, the order of $f(x_1),f(x_2),f(x_3),f(x_4)$ and $=$ or $<$.
 A: Hint
Suppose $f$ is not monotonic, then there exists $a,b,c$ such that $a<b<c$ and $f(a) < f(b) >f(c)$ (of course it could be the other way also i.e. $f(a) > f(b)$ and $f(b) < f(c)$ but the argument will be similar to this one). Note that $=$ is not included otherwise it will contradict the injectivity (one-one). 
Now pick a number $k$ such that $f(a) < k < f(b)$ and $f(c) < k < f(b)$ and apply the intermediate value theorem.
A: *** Here is a complete proof (includes proof for f([a,b])=[f(a),f(b)])***


Theorem: If f : I -> R is a continous injective function, 
then f is either strictly increasing or strictly decreasing
We prove this in 2 parts
A. If f(a) < f(b), then f is strictly increasing
B. If f(a) > f(b), then f is strictly decreasing
Proof for A:
First we prove a 
Lemma 1 If f(a) < f(b) and a < x < b, then f(a) < f(x) < f(b)
Proof: f(a) cannot equal f(x) because a is not equal to x.
Suppose f(a) > f(x). Then f(x) < f(a) < f(b). By IVT, this means
there is x < t < b such that f(t) = f(a) implying t = a by injectivity.
This contradicts a < x < t. So f(a) <  f(x)
Suppose f(x) > f(b). Then f(x) > f(b) > f(a). By IVT, this means
there is x > t > a such that f(t) = f(b) implying t = b by injectivity.
This contradicts b > x > t. So f(x) < f(b) 
Lemma 1 proved.
Now we prove A: If a < x < y < b, then f(x) <  f(y)
Suppose f(x) > f(y). Then f(y) < f(x) and by Lemma 1., f(x) < f(b)
So f(y) < f(x) < f(b). By IVT, this means
there is y < t < b such that f(t) = f(x) implying t = x by injectivity.
This contradicts x < y < t. So f(x) < f(y).
We have proved A.
Proof for B
Since, if f is continous injective, so is (-f),
We can apply A to the function (-f) to prove
If (-f)(a) < (-f)(b), then (-f) is strictly increasing.
This will automatically mean
If f(a) > f(b), then f is strictly decreasing.
A: I think you're on the right track.
Assume there exists $a, b$ in the domain such that for some $c \in (a, b)$, $f(c) < f(a) < f(b)$ (there exists a dip downwards). By intermediate value theorem, there exists $d_1 \in (a, c)$ and $d_2 \in (c, b)$ such that $f(d_1) = f(d_2)$.
Apply the same logic to a descending $f$ and you should also reached a contradiction. $f$ isn't one-to-one.
