# Continuous functions with compact support are dense in $L^1$ (Hypotheses)

In my professor's notes on Lebesgue Integration, the proof of the Theorem above says that we need to prove that for all measurable sets $$E$$ with finite measure, and for $$\epsilon>0$$ exists a function $$g_\epsilon$$, continuous with compact support, such that $$\Vert\chi_E - g_\epsilon\Vert < \epsilon$$. There exists a compact $$K$$ and open $$G$$ such that $$K\subseteq E\subseteq G$$ and $$\lambda(G - K)<\frac{\epsilon}{2}$$. If we find $$g$$ with $$supp(g)\subseteq G$$ and $$\chi_K\leq g\leq 1$$ then $$\Vert\chi_E - g\Vert = \int_K |\chi_E-g|d\lambda + \int_{G-K} |\chi_E-g|d\lambda + \int_{\mathbb{R}^n-G} |\chi_E-g|d\lambda$$ Because $$\chi_E=1$$ in $$K$$ and $$1=\chi_K\leq g\leq 1$$, then $$g=1$$, and the first integral is $$0$$, and because the support is contained in G, then $$g$$ is $$0$$ a.e. in $$\mathbb{R}^n-G$$ and evidently $$\chi_E=0$$ in this set, so the integral is 0 too. Then we get that $$\Vert\chi_E-g\Vert\leq2\lambda(G-K)<\frac{\epsilon}{2}.$$

My question: Where are the hypoteses of $$g$$ being continuous and with compact support used?

• giving a link of those lecture notes and specifying page number might be useful Jan 22 '20 at 13:45
• The notes can be found here drive.google.com/file/d/1qh1M8GrMP6xLxBwZorpKmaAXIpIquWGN/… page 75. Unfortunately they are written in Spanish.
– deiv
Jan 22 '20 at 14:58

Your proof only uses the hypothesis that $$g$$ is measurable, that $$g|_K\equiv 1,$$ $$g|_{\mathbb{R}\setminus G}\equiv 0$$ and $$\|g\|_{\infty}\leq 1$$.
Hence, the real question is: Does such a $$g$$ exist, if we also require $$g$$ to be continuous with compact support? I.e., given $$K\subseteq G$$ with $$G$$ open and $$K$$ compact, does there exist a continuous function with compact support such that $$f|_K\equiv 1$$ and $$f|_{\mathbb{R}\setminus G}\equiv 0$$? This is a special case of Urysohn's Lemma in locally compact spaces.
• Oh, so i see that adding the restriction of a continous and with compact support $f$ still can be found, but these properties are anywhere used to complete the proof. I was having difficulties understanding it because then the proof proceeds to find such a function with those properties, but they aren't seem to be used.