Prove if $f : \mathbb{R}\to\mathbb{R}$ is continuous and $S \subset \mathbb{R}$ is compact, then the image is also compact. I am not 100% sure about my proof, ideally I would like some hints/confirmation on my proof.
Proof:
Since I want to show $f(S)$ is compact I need to show it is closed and bounded.

*

*Closure

Consider a sequence $(x_n) \subset S$ where  $x_n \to L \in S$ (by compactness). Since $L \in S$ we have that since the function is continuous $f(L) \in f(S)$.
Then using sequential continuity on this sequence  $f(x_n) \to f(L) \in f(S)$. Since we can represent any sequence in $f(S)$ as the image of any given sequence in $S$ the set $f(S)$ is closed.

*

*Bounded

Since $S$ is bounded and $f$ continuous, suppose $s^*$ maximises the function $f$ on $S$ - if $f(s^*) \to \infty$ $f$ is not continuous. Since $max(S)$ and $min(S)$ are finite numbers, we cannot have divergence to infinity of the function over the elements of $s$, so $f(s^*)$ is the upper bound of $f(S)$. Repeating for the lower bound I have that S is bounded.
Is my proof correct. I have concerns that my proof for bounded is not very well worded, also I feel like my proof for closure may miss certain cases.
 A: 
Then using sequential continuity on this sequence $f(x_n) \to f(L) \in S$.

For closure what you want to show is that if $f(x_n) \to L$ then $L \in f(S)$.

$f(s^*) \to \infty$

This is meaningless to me. $f(s^*)$ is constant it does not "tend to" anything.

Since $\max(S)$ and $\min(S)$ are finite numbers, we cannot have divergence to infinity of the function over the elements of $S$

Why not, exactly? This is, after all, what you are trying to prove and just stating that it's true is not a proof.

I think the better way to look at this is through the Bolzano-Weierstrass theorem. To show $f(S)$ is compact you need to show that every sequence $y_n = f(x_n)$ has a convergent subsequence and here you can use a convergent subsequence of $x_n$ to reach that conclusion.
A: The idea for the proof is fine as long as you are only concerned about finite dimensional cases. However in general closed and bounded is not a sufficient condition for compactness (in particular in infinite dimensional spaces).
The proof itself also makes some errors, for example what @Max already pointed out.
A: Nothing to do with $\Bbb R$. Let $f: X \to Y$ be a continuosu function between spaces and $S \subseteq X$ compact.
Let $\mathcal{U}$ be an open cover of $f[S]$. Then $\{f^{-1}[U]\mid U \in \mathcal{U}\}$ is an open cover of $S$ by continuity of $f$ and so has a finite subcover $f^{-1}[U_1],\ldots f[U_n]$. Then $\{U_1, \ldots, U_n\}$ is a finite subcover of $\mathcal{U}$. Hence $f[S]$ is compact.
This is the essence.
