Conditions for the preimage of a compact set to be compact. Let $X$, $Y$, be metric spaces. Let $f: X \to Y$ be continuous.  If $X$ is a compact metric space, show that $f^{-1}(K)$ is compact in $X$ whenever $K \subseteq Y$ is compact.
My proof is as follows:
Since $f$ is continuous and since $K$ is compact, $f^{-1}(K)$ is closed.  Since $K$ is compact, $K \subseteq \bigcup\limits_{k=1}^{n}I_k$ where the $I_k$'s form a finite open cover of $K$.  Again, since $f$ is continuous, $f^{-1}(\bigcup\limits_{k=1}^{n}I_k)=\bigcup\limits_{k=1}^{n}f^{-1}(I_k)$, which is a finite open cover of $f^{-1}(K)$.  Thus $f^{-1}(K)$ is compact.
 A: Your proof is wrong. You just proved that exist a finite open cover of $f^{-1}(K)$. The definition of compactness is different. You can try the following:
Combine:


*

*If $X$ is compact and $K\subseteq X$ then $K$ is compact iff $K$ is closed.

*If $f:X\longrightarrow Y$ is continuous and $K\subseteq Y$ is closed then $f^{-1}(K)$ is closed,


to prove:
If $f:X\longrightarrow Y$ is continuous and $X$ is compact then for $K\subseteq Y$ compact $ \Rightarrow K$ is closed $\Rightarrow f^{-1}(K)$ is closed $\Rightarrow f^{-1}(K)$ is compact.
A: There are two problems with your proof:
1) If you don;t know that $Y$ is Hausdorff, then you can't say that $K$ is closed just because it is compact.
2) More importantly: you got the definition wrong - what you proved is that there exists a finite open cover of $f^{-1}(K)$, but what you should have proved is that for any cover of $f^{1}(K)$ there exists a finite sub-covering. So you should start with an arbitrary open cover of $f^{-1}(K)$ and extract a finite open sub-covering from it.
