Proof of the du Bois-Reymond lemma "by approximation" I'm curious about the following argument in Morrey ("Multiple integrals in the calculus of variations", Lemma 2.3.1). Suppose $f\in L^1[0,1]$ and $$\int_0^1 fg\,dx=0$$ for every test function $g\in C^\infty_c[0,1]$. Then, "by approximations," the same is true if $g$ is merely bounded and measurable, in which case we may take $g=\mathrm{sign}(f)f,$ which implies $f=0$ almost everywhere. 
How exactly is one supposed to approximate? Certainly not in the $L^\infty$ norm because the closure of $C^\infty_c[0,1]$ in this norm is not $L^\infty$ itself. Furthermore, $\mathrm{sign}(f)f$ need not be in $L^\infty$, so how does this argument work?
 A: One way to run this argument is to note that you can approximate a bounded measurable function by $C^\infty_c$ functions, almost everywhere and boundedly.  That is, given a bounded measurable $h$, you can find a uniformly bounded sequence $g_n \in C^\infty_c([0,1])$ with $g_n \to h$ almost everywhere.  
There are many ways to see this.  For example, look up your favorite proof that $C^\infty_c([0,1])$ is dense in $L^1([0,1])$.  So you can find a sequence $g_n \to h$ in $L^1$.  Passing to a subsequence, you can get it to converge almost everywhere.  Truncating smoothly at a level higher than $\sup |h|$, you can get the $g_n$ to be uniformly bounded.
So then by the dominated convergence theorem, under the given assumptions, you can conclude that $\int f h = 0$ for all bounded measurable $h$.  Now take $h = \operatorname{sign} f$, so that $fh=|f|$.
I suspect the reference to $\operatorname{sign}(f) f$ is a typo.
A: I will prove a slightly more general results. 

Theorem. If $f\in L^1_{\rm loc}(\Omega)$, $\Omega\subset\mathbb{R}^n$, and
  $$
\int_\Omega f\phi=0
\quad
\text{for all $\phi\in C_c^\infty(\Omega)$},
$$
  then $f=0$ a.e.

Proof.
Suppose that $f\neq 0$. We can assume $f$ is positive on a set of
positive measure (otherwise we replace $f$ by $−f$). Then there is a compact
set $K ⊂ \Omega$, $|K| > 0$ and $ε > 0$ such that $f ≥ ε$ on $K$.
Let $G_i$ be a sequence of open sets such that $K ⊂ G_i ⊂⊂ Ω$, $|G_i \setminus K| → 0$
as $i → ∞$. Take $ϕ_i ∈ C^∞_0(G_i)$ with $0 ≤ ϕ_i ≤ 1$, $ϕ_i|_K ≡ 1$. Then
$$
0 = \int_Ω
fϕ_i ≥ ε|K| − \int_{G_i\setminus K} |f| → ε|K| ,
$$
as $i → ∞$, which is a contradiction. The proof is complete. 
