Let $1\leq p<\infty$ and take the set $\Bbb{R}$ equipped with the Borel-$\sigma$-algebra. Define $L_c^p(\Bbb{R})=\{f\in L^p(\Bbb{R}): \{f\neq 0\} ~\text{is bounded in } \Bbb{R}\}$. I need to show that $L_c^p(\Bbb{R})$ is dense in $L^p(\Bbb{R})$
My idea was to show that $L_c^p(\Bbb{R})$ is closed and it's closure is $L^p(\Bbb{R})$ then we would be done. But I have some problems in proving that it's closed. If I take a convergent subsequence $f_n$ in $L_c^p(\Bbb{R})$, say $f_n\rightarrow f\in L^p(\Bbb{R})$ then how can I show that $\{f\neq 0\}$ is bounded?
Could maybe someone help me how to solve this exercise?
For given $n$ let $f_n:\mathbb R\rightarrow\mathbb R$, $x\mapsto\unicode{120793}\{-n\le x\le n\}f(x)$. Notice that $|f_n|^p$ is non-negative and converges to $|f|^p$ from below, so by the monotone convergence theorem we have $\|f_n\|_p^p\rightarrow\|f\|_p^p$. Notice that $|f(x)-f_n(x)|^p=\unicode{120793}\{x\not\in[-n,n]\}|f|^p$ and hence $\|f-f_n\|_p^p=\|f\|_p^p-\|f_n\|_p^p\rightarrow 0$. This completes the proof, since every point is a limit point of functions with bounded support.