Proof of fundamental lemma of calculus of variation. Suppose $\Omega$ is an open subset of $\mathbb{R}^n$ and let $L^1_\text{Loc}\Omega$ denote all locally integrable functions on $\Omega$ and $C^{\infty}_0\Omega$ for smooth functions whose support lie in $\Omega$. My teacher tell me the following statement:
Suppose $f\in L_{Loc}^1\Omega$ and
$$\int_\Omega f\varphi=0,\forall\varphi\in C^\infty_0\Omega$$
Then $f=0\text{ a.e.}$ 
It is known as fundamental lemma of calculus of variation. My teacher told me it suffices to prove this statement holds for the case $f$ is continuous. But I find it's not easy to deduce the lemma from the case $f$ is continuous. Could someone tell me how to do this or how to prove the lemma directly?  Thanks a lot!
 A: I will now outline a proof I managed to come up with, so as to have this outline available online. It seems a web search does not present a proof that doesn't assume continuity on the part of $f$…
Continuous case
If $f$ is continuous, the steps are two:


*

*Prove the hypothesis stays true if you substitute smooth compactly supported (henceforth cs) functions with characteristics of balls; this is achieved via smooth transitions, which approximate characteristics of balls pointwise (but evidently not uniformly);

*$f$ is continuous, so if $f(x)\neq0$ for some $x$, there exists a ball around $x$ where $f$ has constant sign; integrate $f$ times the characteristic of that ball and you should get something nonzero by what I just said, and zero by step 1: a contradiction; so $f=0$ everywhere.


General case
The proof here is much longer.


*

*Approximate continuous functions uniformly (and thus in $L^1$ and pointwise a.e.) by convolutions; in other words, define:
$$\rho_n(x)=\left\{\begin{array}{cc}
n^Ne^{\frac{1}{1-\|x\|^2}} & \|x\|\leq1 \\
0 & \text{otherwise}
\end{array}\right.,$$
where $N$ is the dimension of the space $f$ is defined on (i.e., $f:\Omega\subseteq\mathbb{R}^N\to\mathbb{R}$); then let:
$$\rho_n\ast u(x)=\int_{\mathrm{supp}(u)}\rho_n(x-y)u(y)\mathrm{d}y=\int_{B(0,\frac1n)}\rho_n(y)u(x-y)\mathrm{d}y.$$
By the first expression, this is a smooth function; the support is the sum of the ball and the support of $u$, thus if $u\in C_c(\Omega)$, the support is compact; finally, using the second expression and a few manipulations, one can prove $\rho_n\ast u-u$ has $L^1$ norm less than the supremum of $\|\tau_yu-u\|_{L^1}$ over $|y|<\frac1n$, where $\tau_yu(x)=u(x-y)$; that $L^1$ norm reduces to integrating over the compact support of $u$, thus $u$ is uniformly continuous there, and this can be used to prove that sup tends to zero, and hence $\rho_n\ast u\to u$ in $L^1$; a subsequence thus converges a.e., everything here is bounded by the sup of $u$ which is continuous and compactly supported therefore bounded, so we have a domination and we conclude $f\rho_n\ast u\to fu$ in $L^1$, so the integrals converge, but the LHS always integrates to 0;

*For any $\frac1n$, one has a finite cover of a compact set $K\subseteq\Omega$ by balls of radius $\frac1n$, and thus a partition of unity, i.e. a collection of $\phi_i^{(n)}$ which are in bijection with those balls, are each zero outside the matching ball, and sum to 1 on $K$ and less than 1 out of it; plus, they are continuous, so $f\sum\phi_j^{(n)}$ always integrates to 0; finally, those converge pointwise (at least a.e.) to the indicator of $K$, so since we have a domination we conclude the integrals of $f\sum\phi_i^{(n)}$ tend to the integral of $f$ over $K$ as $n\to\infty$, but those integrals are all 0 by step 1; hence $f$ integrates to 0 over all compact subsets of $\Omega$;

*The Lebesgue measure is inner regular, so there is, for any measurable $M\subseteq\Omega$, a sequence $K_n$ of compacts such that $\mu(K_n)\to\mu(M)$; this easily implies $L^1$ convergence of the indicators of those compacts to that of $M$; thus, along a subsequence, there is pointwise a.e. convergence; so I should be able to deduce the integrals of $f$ over those compacts converge to that of $f$ over $M$, but I'm not so sure I can use dominate convergence here; perhaps I can just restrict myself to the sets below…;

*$f$ is measurable due to integrability, hence $F^+:=\{f>0\},F_-:=\{f<0\}$ are both measurable; their characteristics are approximated by characteristics of compact subsets as shown above; in those cases, I can apply Fatou if Dominated Convergence doesn't apply; Fatou surely yields $\int_\Omega f^+\leq0$, as well as the integral of $f^-$; but those functions are positive, hence those integrals are 0, and they sum to $\int_\Omega|f|$, which is therefore 0; and bingo: this implies -- at long last!! -- $f=0$ a.e..
Can someone please verify these steps, and say if I've gone wrong at some point? In particular, in general case step 3, I'm afraid DC is unavailable in general since if $\Omega$ is not bounded a constant is no domination, and besides I still have $f$ around which is only locally integrable, so I can use DC if $M$ is contained in a compact set, otherwise $f$ integrated over $M$ might well be infinite… so can I use DC to simplify things or do I have to use Fatou on the sets of point 4?
