Question: 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?

Answer: 
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.
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.