Continuous images of compact sets are compact

Let $X$ be a compact metric space and $Y$ any metric space. If $f:X \to Y$ is continuous, then $f(X)$ is compact (that is, continuous functions carry compact sets into compact sets).

Proof:

Consider an open cover of $f(X)$.

Then $f(X) \subset \bigcup_{\alpha \in A}V_\alpha$ where each $V_\alpha$ is open in $Y$.

$X \subset f^{-1}(f(X)) \subset f^{-1}\left(\bigcup_{\alpha \in A}V_\alpha\right) = \bigcup_{\alpha \in A}f^{-1}(V_\alpha)$.

Hence $\bigcup_{\alpha \in A}f^{-1}(V_\alpha)$ is an open cover of $X$. Since $X$ is compact then we can choose a finite subcover $\{V_i\}_{i=1}^n$ such that $X \subset \bigcup_{i=1}^n f^{-1}(V_i)$.

So then $f(X) \subset f\left(\bigcup_{i=1}^n f^{-1}(V_i)\right) = \bigcup_{i=1}^n f\left(f^{-1}(V_i)\right) \subset \bigcup_{i=1}^n V_i$, a finite subcover of $f(X)$. $\therefore f(X)$ is compact.

Does this proof have an error?

Thanks for your help.


The proof is not good. Knowing that $f$ is continuous does not say much about $f^{-1}$, while the proof assumes that it exists and is continuous. It was not given that $f$ is a homeomorphism.

The statement is still true though. Take any sequence $x_n$ in compact $X$. Then it has a convergent subsequence $x_q$ (by definition of compactness). Now take the sequence $f(x_n)$ and notice that it has a convergent subsequence $f(x_q)$ (by definition of continuity). Since for any point $y \in f(X)$ there exists $x \in X $ such that $f(x) = y$, every sequence if $f(X)$ can be written as $f(x_n)$ for some sequence $x_n \in X$ and we are done.