# 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.

-
I think you're assuming that since $K$ is compact, it is also closed, which is not necessarily the case. Simply consider an infinite set with co-finite topology, also called the finite complement topology. –  Clayton Dec 3 '12 at 6:22
@Jonas I have corrected that. –  emka Dec 3 '12 at 6:27
@Clayton: The problem has been updated to say that $X$ and $Y$ are metric spaces. –  Jonas Meyer Dec 3 '12 at 6:31

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:

1. If $X$ is compact and $K\subseteq X$ then $K$ is compact iff $K$ is closed.
2. 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.

-

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.

-
The problem has been updated to say that $X$ and $Y$ are metric spaces. –  Jonas Meyer Dec 3 '12 at 6:30