If $A$ is compact, is then $f(A)$ compact?

I just got my exam back, and I still cannot understand this question:

Given a continuous function $f:A\subseteq\mathbb{R}\to\mathbb{R}$, show that if $A$ is a compact set, then its image, $f(A)$, is also compact.

I know that a set $A\subseteq\mathbb{R}$ is compact if every sequence in $A$ has a subsequence that converges to a limit that is also in $A$, and I know that a function $f$ is continuous on $A$ if for every $(x_n)\subseteq A$ such that $x_n\to c\in A$, it follows that $f(x_n)\to f(c)$. Therefore, all that I need to do is show that for every $(y_n)\subseteq f(A)$, there is a subsequence $(y_{n_k})$ such that $y_{n_k}\to y\in f(A)$.

Can I then make the assumption that for any sequence $(y_n)\subseteq f(A)$, there is a sequence $(x_n)\subseteq A$ such that $y_n=f(x_n)$? If so, I could then continue by stating that since $A$ is compact, there is a subsequence $(x_{n_k})$ such that $x_{n_k}\to x\in A$, and since $f$ is continuous, $f(x_{n_k})\to f(x)$. I believe that this yields the required subsequence $(y_{n_k})$ of $(y_n)$ such that $y_{n_k}=f(x_{n_k})\to f(x)=y\in f(A)$.

What do you guys think? Is this a sound approach? Thanks in advance.


That's perfectly correct. The only qualm I can imagine any reasonable grader would have with your argument, is that you are using the fact that compact metric spaces are sequentially compact; whereas, the result can by proven directly from the open cover definition of compactness: if $\cal A$ is an open cover of $f(A)$, then ${\cal B}=\{f^{-1}(A) |A\in {\cal A}\}$ is an open cover of $A$. Extract a finite subcover $\{f^{-1}(A_1),\ldots,f^{-1}(A_k)\}$ of $A$ from $\cal B$ to obtain the finite subcover $\{A_1\ldots A_k\}$ from $\cal A$ of $f(A)$.


There is a slightly different approach that doesn't depend on sequential compactness: Let $({{U_{\alpha}}})_{\alpha \in J}$ be an countable open cover of $f(A)$. Since $f^{-1}f(A) \supseteq A$, $A$ is contained in the inverse image of the open cover; in other words, $A \subseteq f^{-1}(\bigcup_{\alpha \in J}{{U_{\alpha}}}) = \bigcup_{\alpha \in J}f^{-1}({U_\alpha})$. $f$ is continuous, so these sets are still open in $A$.

As $A$ is compact and we have an open cover of $A$, there exists a finite subcover of the $U_{\alpha}$ that covers $A$; call it $(f^{-1}(A_1), ..., f^{-1}(A_n))$. Now $f(A) \subseteq f(\bigcup_{i = 1}^{n} f^{-1}(A_i)) \subseteq \bigcup_{i=1}^{n}A_i$, and we have a finite subcover for our open cover of $f(A)$. As this holds for a general open cover of $f(A)$, the space is compact.