The following results hold.
- Theorem Let $\Omega\subset\mathbb{R}^n$ be an open set. Then $C^0_c(\Omega)$ is dense in $(L^p(\Omega),\|\cdot\|_p)$, if $1\le p<\infty$.
- Theorem Let $\Omega\subset\mathbb{R}^n$ be an open set. Then $C^\infty_c(\Omega)$ is dense in $(L^p(\Omega),\|\cdot\|_p)$, if $1\le p<\infty$.
Why these result do not hold for $p=\infty$? Maybe because $L^{\infty}$ is not separable?
The compactly supported part is most important. Try to $L^\infty$-approximate the constant function $g \equiv 1$ by a compactly supported function $f$. There will be a set of positive measure where $f$ is zero, so $\| f - g \|_\infty$ will always be at least $1$ no matter what $f$ we pick.