I'm having trouble finding a simple proof of the fact that
If $f$ is locally integrable on $\mathbb R^n$, and $\int f \phi = 0$ for all test functions $\phi$, then $f=0$ almost everywhere.
Terrence Tao offers this as an exercise, with the only hint being to use the density of the test functions in $L^p(\mathbb R^n)$. My textbook (Duistermaat & Kolk) only has a proof of a much, much more general result, which I can't really wrap my head around, but it seems to use the density of the test functions in $L^1$.
I thought maybe it could be proved something like this, where $\phi_n$ approximate $f$ in $L^1$:
$$\int f\phi_n =0\implies \int f^2=0\implies f=0$$
Where the integrals are possibly taken on compact sets, and the second step is justified by taking $n\to\infty$. Can this reasoning be made rigorous? Or, is there a simple proof of this result, using only the density result mentioned above?
Let $K$ be a compact in $\Bbb R^n$ and $\psi$ be a test function such that $\psi = 1$ on $K$, $0 \le \psi \le 1$ everywhere and $\psi = 0$ outside a neighborhood of $K$ (such a $\psi$ exists - it's often called a cut-off function. Let me know if you need help in constructing it). Then $f \psi \in L^1$. Let $(\phi_{\epsilon})$ be a mollifier. Then: $\phi_{\epsilon} \star (f\psi) (x) = \int\phi_{\epsilon}(x-y) f(y)\psi(y)dy = 0$ for all $x \in \Bbb R^n$ since $y \mapsto \psi(y)\phi_{\epsilon}(x-y)$ is a test function. Recall that, since $f\psi \in L^1$, $\phi_{\epsilon} \star f\psi \to f\psi$ in $L^1$. It follows that $\int |f\psi| = 0$. So $f\psi = 0$ a.e. on $K$, and since $\psi =1$ on $K$, $f = 0$ a.e. on $K$. Since $\Bbb R^n$ can be exhausted by countably many compacts, it follows that $f = 0$ a.e. on $\Bbb R^n$.