Continuous function on a compact metric space The question is:
Suppose $f\colon X\to Y$ is continuous on a compact metric space $X$, $Y$ is a metric space and $C\subset Y$ is closed. Show that for any open neighborhood $U$ of $f^{-1}(C)$ in $X$, there exists an open neighborhood $V$ of $C$ in $Y$ such that $f^{-1}(V)⊂U$.
I have tried to argue that $f^{-1}(C)$ is closed (and hence compact) by continuity of $f$ and compactness of $X$, then $C=f(f^{-1}(C))$ is also compact by continuity of $f$ again.
But the compactness of the two sets seems don't help me very much.
Can anyone help me? Thx!
 A: This does not seem to be true as it is currently stated. (Edit: Or before it was added that $Y$ is also a metric space).
Take $Y=\{0,1\}$ and $\tau=\{\emptyset,\{0\},\{0,1\}\}$, and choose $f:[0,1]\to (\{0,1\},\tau\,)$ by setting $f(\frac{1}{2})=1$ and $f(x)=0$ otherwise. The preimage of every open set is open so this function is continuous, and $[0,1]$ is a compact metric space. Take $C=\{1\}$, which is a closed subset of $\{0,1\}$ since its complement is open, and $f^{-1}(C)=\{\frac{1}{2}\}$. Now by taking $U=]\frac{1}{4},\frac{3}{4}[$, for example, as an open neighborhood of $f^{-1}(C)$ in $[0,1]$, then $f^{-1}(\{0,1\})=[0,1]\not\subset ]\frac{1}{4},\frac{3}{4}[$, and $\{0,1\}$ is the only open set containing $C$. So for any open neighbourhood $V$ of $C$ we have $f^{-1}(V)\not\subset U$.
A: Let $U$ be an open neighborhood of $f^{-1}(C) \Longrightarrow U^c\cap f^{-1}(C)=\emptyset$.
Then $U^c$ is compact $\Longrightarrow f(U^c)$ is compact $\Longrightarrow$ closed and $C\cap f(U^c)= \emptyset$ (Proof: If $x\in C\cap f(U^c)$ then $x=f(a)$ for some $a\in U^c \Longrightarrow$ $a\in U^c\cap f^{-1}(C)=\emptyset$ ↯).
Now we find $V$ open with $C\subset V $ and $V\cap f(U^c)=\emptyset$.
Show that $f^{-1}(V) \cap U^c=\emptyset$. Therefore $f^{-1}(V)\subseteq U$ .
