TITLE: Show the image of a continuous function on a closed interval is closed.
QUESTION [7 upvotes]: I tried this problem on my own, but got 1 out of 5. Now we are supposed to find someone to help us. Here is what I did:
Let $f:[a,b] \rightarrow \mathbb{R}$ be continuous on a closed interval $I$ with $a,b \in I$, $a \leq b$
If $f(a), f(b) \in f(I)$ let $f(a)\leq y \leq f(b)$. Then by IVT there exists $x$, $a\leq x \leq b$ where $f(x)=y$ $Rightarrow$ The image is also an interval. 
Show closed: Let m be the lowest upper bound and M the greatest lower bound of the image interval. $I=[a,b]$ must be a subset of $[M,m]$ and the function attains its bounds, 
$m,M\in f(I)$. so $f(I)$ is a subset of $[M,m]$, thus is closed. 
Can anyone provide a proof of this statement? Thanks!

REPLY [2 votes]: Closed intervals are compact in $ \mathbb{R}$. $f$ continuous implies image of $f$ is compact. By Heine-Borel, we know that compact sets are closed and bounded in $\mathbb{R}$, in particular.
Since a closed set contains its sup and inf use that to show that they form the end points of the interval and use the IVP to conclude that it is a closed interval.