Let $f: [a,b] \rightarrow [c,d]$ be a monotonic function, so that $image(f)=[c,d]$. Show that $f$ is continuous in $[a,b]$ Let $f: [a,b] \rightarrow [c,d]$ be a monotonic function, so that $Im(f)=[c,d]$. Show that $f$ is continuous in $[a,b]$
What I started: 
$f: [a,b] \rightarrow [c,d]$ is a monotonic function, so WLOG, if $x_1 \leq x_2$ then $f(x_1) \leq f(x_2)$. Let there be some point $x_0 \in (a,b)$, and since $image(f)=[c,d]$, then $f(x_0)$ exists and in $[c,d]$.  
$f$ is monotonic, so $\lim_{x \rightarrow x_0^-}f(x) \leq f(x_0) \leq \lim_{x \rightarrow x_0^+}f(x)$. 
How can I continue from here?
If possible, hints only. 
Thank you!   
 A: Let's prove that if $t\in(a,b)$, then
$$
\lim_{x\to t^-}f(x)
\qquad\text{and}\qquad
\lim_{x\to t^+}f(x)
$$
exist whenever $f$ is monotonic on $[a,b]$. Set $r=\sup\{f(x):x<t\}$, which is finite, because $f(x)\le f(b)$, for every $x\in[a,b]$.
Let's show that $r=\lim_{x\to t^-}f(x)$. Take $\varepsilon>0$; then, by the definition of supremum, there exists $x_0<t$ such that $r-f(x_0)<\varepsilon$. Set $\delta=t-x_0$; if $x_0=t-\delta<x<c$, then $f(x)\ge f(x_0)$ and
$$
r-f(x)\le r-f(x_0)<\varepsilon
$$
as required.
Similarly, considering $s=\inf\{f(x):x>c\}$ we can prove that
$$
\lim_{x\to c^+}f(x)=s.
$$
Note that $r\le s$ (prove it).
The special cases of $\lim_{x\to a^+}f(x)$ and $\lim_{x\to b^-}f(x)$ are not really special and it's obvious that $\lim_{x\to a^+}f(x)=f(a)$ and $\lim_{x\to b^-}f(x)=f(b)$.
Until now we have not used the fact that the image of $f$ is $[c,d]$. So this is a general result about monotonic functions on an interval.
Now, suppose that at some point $t$, we have
$$
r\lim_{x\to t^-}f(x)<\lim_{x\to t^+}f(x)=s
$$
Then no element in the interval $(r,s)$ is in the image of $f$; indeed, if $r<f(x)<s$, then $x\ge t$, because $r=\sup\{f(x):x<t\}$, and $x\le t$, because $s=\inf\{f(x):x>t\}$. Thus $x=t$, but this is a contradiction, because it applies to all elements in $(r,s)$, which is infinite.
Similarly, $f(a)=\lim_{x\to a^+}f(x)=c$ and $f(b)=\lim_{x\to b^-}f(x)=d$.
A: $\textbf{Hint:}$ Use definition of continuous function. 
Choose any $x_0 \in (a,b)$ and prove that $f$ is continuous at point $x_0$.So choose any $\varepsilon >0$ and let $f(x_0)=y \in [c,d]$. Image of $[a,b]$ by function $f$ is whole $[c,d]$ and $f$ is monotonous function, so there exists $x_1 ,x_2\in [c,d]$ that $f(x_1) \leq f(x_0)+\varepsilon$ and $f(x_2) \geq f(x_0)-\varepsilon$. Let $\delta=\min(|x_0-x_1|,|x_0-x_2|)$ What can you tell about $f$ between $x_1$ and $x_2$?
