I want to prove that a function has compact support. (I'm writing a thesis on the moment problem). I have proven with help from Urysohns lemma, with the normal space $X$, that there exists a $K \subseteq U$, where $K$ is compact and $U$ is open in $X$. Then there exists a continuous function $f: X \rightarrow [0,1]$ such that:
$0 \leq f \leq 1, \quad f(x) = 1$ for $x \in K, \quad $supp$(f) \subseteq U$.
Now i just need to prove that $f$ has compact support, which i need help with. I hope someone can help.
The way to prove it is by a compactness argument, we know that $K \subseteq V \subseteq \overline{V} \subseteq U$ where $\overline{V}$ is compact. (see comment) We set $A=X \backslash V$ instead, so $f(x)=0$ for $x \notin V$. This way we know that that supp$(f) \subseteq \overline{V}$ and then the support is compact, because it's a closed set within a compact set.