I'm trying to prove a result in this thread.
Theorem Let $(X, d)$ be a locally compact metric space, Then the space $\operatorname{Lip}_c (X)$ of Lipschitz continuous functions with compact supports is dense in the space $\mathcal C_c(X)$ of continuous functions with compact supports.
Could you check if my below attempt is fine?
Proof Let $\varepsilon>0$ and $f:X \to \mathbb R$ be continuous with compact support. Let's construct a Lipschitz continuous function $\bar f:X \to \mathbb R$ with compact support such that $\|f-\bar f\|_\infty < 2\varepsilon$. We need the following lemmas.
Lemma 1 Let $X$ be a locally compact Hausdorff topological space. Let $K$ be a compact subset of $X$ and $U$ an open subset of $X$ such that $K \subset U$. Then there is an open subset $V$ of $X$ such that $K \subset V \subset \overline V \subset U$ and $\overline V$ is compact.
Lemma 2 The space $\operatorname{Lip}_b (X)$ of bounded Lipschitz continuous functions is dense in the space $\mathcal C_b(X)$ of bounded continuous functions w.r.t. the supremum norm.
Let $K := \operatorname{supp} f$. By Lemma 1, there is an open subset $V$ of $X$ such that $K \subset V$ and $\overline V$ is compact. By Lemma 2, There is a bounded Lipschitz continuous function $h:V \to \mathbb R$ such that $\sup_{x \in V} |f(x)-h(x)| < \varepsilon$. This implies $\sup_{x \in V \setminus K} |h(x)| < \varepsilon$.
By Urysohn's lemma, there is a Lipschitz continuous $g:X \to [0, 1]$ such that $g(K)=1$ and $g(X \setminus V) = 0$. We define $\bar f$ by $\bar f (x) := h(x) g(x)$ for all $x \in V$ and $0$ otherwise. The product of two Lipschitz functions is again Lipschitz, so $\bar f$ is Lipschitz. Clearly, $\operatorname{supp} \bar f \subset \overline V$ and thus $\operatorname{supp} \bar f$ is compact. We have $$ \begin{align} \|f-\bar f\|_\infty &=\sup_{x \in V} |f(x)-\bar f(x)| \\ &\le \sup_{x \in V} |f(x)-h(x)| + \sup_{x \in V} |\bar f(x)-h(x)| \\ &\le \varepsilon +\sup_{x \in V} |\bar f(x)-h(x)|. \end{align} $$
We have $$ \begin{align} \sup_{x \in V} |\bar f(x)-h(x)| &=\sup_{x \in V \setminus K} |\bar f(x)-h(x)| \\ &= \sup_{x \in V \setminus K} |h(x)| \cdot |g(x)-1| \\ &\le \sup_{x \in V \setminus K} |h(x)| < \varepsilon. \\ \end{align} $$
It follows that $\|f-\bar f\|_\infty \le 2 \varepsilon$. This completes the proof.