So I'm trying to prove the following:
Suppose $a,b\in\mathbb{R},\quad a<b$ and $f:[a,b]\rightarrow \mathbb{R}$ a strictly increasing function.
Prove that $f$ continuous if and only if there exist $c,d\in\mathbb{R}$ with $f([a,b])=[c,d]$
My attempt: Suppose $f([a,b])=[c,d]$ with $c,d$ like above. Then $f$ is invertible because it is both injective (strictly increasing) and surjective. Consider a point $f(p)\in [c,d]$, and let $\epsilon>0$. Pick $f(x)\in [c,d]\setminus f(p) $ such that $d(f(x),f(p))<\epsilon$ and assume without loss of generality that $f(x)<f(p)$. (The other case is entirely analogous.) Then there exists some $f(x)<f(x_0)<f(p)$ and because $f(x_0)\in [c,d],\quad x_0\in f^{-1}([c,d])=[a,b]$. Here we'll use the strictly increasing nature of $f$ to conclude $x<x_0<p$ with $x,x_0,p\in[a,b]$ Thus, if we let $$d(x_0,p)<d(x,p),\qquad d(f(x),f(p))<\epsilon$$ Which is exactly the definition of continuity.
Conversely, suppose $f$ is continuous on $[a,b]$. Knowing that the image of a closed set is against closed under a continuous function, $f([a,b])$ is closed. Suppose $t\in [a,b]$, then because $f$ is strictly increasing, $f(a)\leq f(t)\leq f(b)$, and $f([a,b])\subset [f(a),f(b)]$. Consider $f(s)\in[f(a),f(b)]$, then $f(a)\leq f(s) \leq f(b)$ so $a\leq s \leq b$ and $s\in [a,b]$. Therefore $[f(a),f(b)]\subset f([a,b])$ and $f([a,b])=[c,d]$ for some $c, d\in \mathbb{R}$.
Comments: Now, I'm pretty sure that this proof is fine, but the exercise is an old exam question which makes me think that the proof is overly convoluted and could be done much simpler. I'd like some help in that.