Prove if $f : \mathbb{R}\to\mathbb{R}$ is continuous and $S \subset \mathbb{R}$ is compact, then the image is also compact.

compactnesscontinuityfunctionsgeneral-topology

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.

Best Answer

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.