Define $C_0(\mathbb{R}^n)$ to be all continuous functions with compact support. I managed to show the claim in the case $1\leq p <\infty$ and $A=\mathbb{R}^n$. This was done in steps:
-
Use Urysohn's lemma to show that you can approximate characteristic functions of measurable sets by functions in $C_0(\mathbb{R}^n)$.
-
From 1) it follows that simple functions can be approximated by
functions in $C_0(\mathbb{R}^n)$. -
Show that simple functions are dense in $L^p(\mathbb{R}^n)$. From
this it immediately follows along with 2) that
$C_0(\mathbb{R}^n)\subset L^p(\mathbb{R}^n)$ is dense.
I also think that when $p=\infty$ the claim does not hold. This is because the uniform limit of continuous functions is continuous. Therefore one cannot approximate for example the step function $\chi_{[0, \infty)}$ by functions in $C_0(\mathbb{R}^n)$.
So my question is: can we use the same proof for arbitrary measurable set $A$? Can we just conclude that $C_0(A)\subset L^p(A)$ is dense and extend the functions in $C_0(A)$ by zero to $C_0(\mathbb{R}^n)$? Or am I missing something crucial here?
Thank you!
Best Answer
If $f\in L^{p}(A)$ then extend $f$ to $L^{p}(\mathbb R^{n})$ by making it $0$ outside $A$. Approximate $g$ by $C_0(\mathbb R^{n})$ function $h$. Then $h$ approximates $f$ on $A$. I don't think the question has anything to do with $C_0(A)$ (which does not even make sense for a general measurable set $A$).