Prove that an increasing and surjective function is continuous.
Solution 1:
Sincé $f$ is increasing, $f(x^+)$ and $f(x^-)$ both exist. Furthermore
$\tag 1f(x^-)\le f(x)\le f(x^+).$
Now, suppose there is a point $c\in [a,b]$ at which $f$ is not continuous. Then, there are two possibilities:
$a). f(x^-)=f(x^+)$ in which case $f(c)\neq f(x^+)$ because $f$ is assumed discontinuous at $c$. But this contradicts $1).$
$b). f(x^-)<f(x^+),$ in which case at least one of $[f(x^-),f(c)]$ or $[f(c), f(x^+)]$ is a non-degenerate interval, which contradicts the surjectivity of $f$.
Solution 2:
Well, let's try to do this using just the basic, strict, definition of $(\epsilon,\delta)-$continuity.
Recall that surjectivity means that for all $z\in [f(a),f(b)]$, there exists a $x\in [a,b]$ such that $f(x)=z$ and that being increasing (not strictly) means that if $x\leq y$, then $f(x)\leq f(y)$.
Towards a contradiction, for it to be non continuous in a point $c$, you need an $\epsilon >0$ such that $\forall\delta>0, \exists y\in]c-\delta, c+\delta[$ such that $\mid f(y)-f(c)\mid \geq \epsilon$.
But then, if there exists such an $\epsilon$ and such a $y$, it would means that in the interval $[f(y),f(c)]$ (wlog $f(y)<f(c)$, note $y\neq c$), is of length at least $\epsilon$, so there exists values inside and by surjectivity, those values have an preimage : $\forall z\in \; ]f(y),f(c)[, \; \exists x\in[a,b]$ such that $f(x)=z$.
But now, $f(a)\leq f(y)< f(x)< f(c) \leq f(b)$ implies by monotonicity (being increasing here) that $x\in\;]y,c[\; \subset\; ]c-\delta,c+\delta [$. This does the magic and comes from the fact that if $A\implies B$, then $\neg(B) \implies \neg(A)$.
So, since this is true $\forall\delta$ and $\forall z$, we can pick $\delta=\epsilon$ for example and $z=f(c)-\frac{\epsilon}{2}$, we have that there exists an element $x$ in $]y,c[$ such that $f(x)=f(c)-\frac{\epsilon}{2}>f(y)$, so $\mid f(x)- f(c) \mid = \mid f(c)-\frac{\epsilon}{2}-f(c)\mid=\frac{\epsilon}{2}<\epsilon$, which means that for $\delta = \epsilon/2$, then the value $y'\in ]c-\frac{\epsilon}{3},c+\frac{\epsilon}{3}[$ so that $\mid f(c)-f(y')\mid \geq \epsilon$ (which has to exists since we assumed non-continuity) can not be in $]c-\frac{\epsilon}{3},c[$ since we have monotonicity implying $f(x)\leq f(y')\leq f(c)$ if it were there and $f(x)$ being at distance $\epsilon/2<\epsilon$ from $f(c)$ and so, $y' \in ]c,c+\frac{\epsilon}{3}[$ is such that $\mid f(y')-f(c) \mid \geq \epsilon$ implies that we have a non empty interval of length $\epsilon$ there were we can pick the value $f(c)<f(c)+\frac{\epsilon}{4}<f(y')$ and there exists again a $x'\in ]c,c+\frac{\epsilon}{3}[$ such that $f(x')=f(c)+\frac{\epsilon}{4}$, so $\mid f(x')-f(c)\mid = \frac{\epsilon}{4}$.
But then it means that we have found an interval around $c, [x,x']$ such that $f(x)-f(x') = f(c)-\frac{\epsilon}{2}-f(c)-\frac{\epsilon}{4} = \frac{3}{4}\epsilon < \epsilon$ so every possible value $x\leq z\leq x'$ is such that $f(c)-\frac{\epsilon}{2}<f(z)<f(c)+\frac{\epsilon}{2}$ which means that for $\delta=\min\{\mid x'-c\mid,\mid x-c\mid\}$ there are no $y'' \in \big[c-\delta, c+\delta\big]$ such that $\mid f(y'')-f(c)\mid \geq \epsilon$ which is a blatant contradiction of our assumption that it wasn't continuous.
PS : this is not "enough" in the sense that I do not talk about the extrema, but you can do it there using the same method. And you may need to be more careful here and there when taking open/closed intervals.
Solution 3:
Take $c\in (a,b)$, and let $\epsilon>0$ be given; assume for now that $f(c)+\epsilon\leq f(b)$ and $f(c)-\epsilon\geq f(a)$. Then by surjectivity there exist $x_1,x_2\in[a,b]$ such that $f(x_1)=f(c)-\epsilon$ and $f(x_2)=f(c)+\epsilon$. Set $\delta=\min\{c-x_1,x_2-c\}$, and use the fact that $f$ is increasing.
If you can't shrink $\epsilon>0$ so that $f(c)+\epsilon\leq f(b)$ and $f(c)-\epsilon\geq f(a)$, then $f(c)=f(b)$ and/or $f(c)=f(a)$, so you will have to deal with these cases. Can you finish it from here?