Integral of Function in $L^p(E)$ Times Functions in Dense Set Being $0$ Implies Function is $0$
Solution 1:
Let $g_{n}=\text{sgn}(f)\chi_{\{|x|\leq n, |f|\leq n\}}$, where $\text{sgn}(f)(x)=\overline{f(x)}/|f(x)|$ for $f(x)\ne 0$ and $\text{sgn}(f)(x)=0$ for otherwise, then $g_{n}\in L^{1}$ and we can find a $\varphi_{n}\in S$ such that $\|g_{n}-\varphi_{n}\|_{L^{1}}<1/n$, then we have \begin{align*} \left|\int_{E}fg_{n}\right|&\leq\left|\int_{E}f(g_{n}-\varphi_{n})\right|+\left|\int_{E}f\varphi_{n}\right|\\ &\leq\dfrac{1}{n}\|f\|_{L^{\infty}}. \end{align*} But $0\leq fg_{n}(x)\uparrow|f(x)|$ a.e. $x$ as $n\rightarrow\infty$ since $f\in L^{\infty}$ implies that $|f(x)|<\infty$ a.e., so we have by Monotone Convergence Theorem that \begin{align*} \int_{E}|f|=\lim_{n\rightarrow\infty}\int_{E}fg_{n}=0. \end{align*}