I'm having trouble proving an exercise in Folland's book on real analysis.
Problem: Consider a locally compact Hausdorff space $X$. If $K\subset X$ is a compact $G_\delta$ set, then show there exists a $f\in C_c(X, [0,1])$ with $K=f^{-1}(\{1\})$.
We can write $K=\cap_1^\infty U_i$, where the $U_i$ are open.
My thought was to use Urysohn's lemma to find functions $f_i$ which are 1 on $K$ and $0$ outside of $U_i$, but I don't see how to use them to get the desired function. If we take the limit, I think we just get the characteristic function of $K$.
I apologize if this is something simple. It has been a while since I've done point-set topology.