We work on $(X,\tau)$ a topological space. We have two different definitions for $C_0(X)$, the set of continuous functions vanishing at infinity. The first is $ C_0(X) = \mathrm{cl}_X(C_c(X)) $ the closure (with respect to the topology induced by the distance function $d(f,g) = \sup_X |f-g|$) of the set of continuous functions with compact support. The second is $ C_0(X) = \{f:X \to \mathbb{R} \text{ continuous}: \forall\epsilon>0\ \exists K \text{ closed compact s.t. } |f|<\epsilon \text{ on } X\setminus K \}. $
I am trying to show that if $f$ satisfies the second definition, then it satisfies the first. The way I am going about it basically comes down to having $|f|\leq \epsilon$ outside of a compact set $K$, and I need to find a continuous compactly supported $g$ with $g=f$ on $K$ and $g=0$ outside another compact set $K_2 \supseteq K$, but I don't see how I could extend $g$ continuously in such a manner. How should I proceed?