Assume that $f\in {L}_{\text{loc}}^{1}({\mathbb{R}}^{n},\mathbb{R})$ is such that

${\int}_{{\mathbb{R}}^{n}}f(x)g(x)dx\ge 0$

for all $g\in {C}_{c}({\mathbb{R}}^{n},{\mathbb{R}}^{+}).$ Here ${C}_{c}({\mathbb{R}}^{n},{\mathbb{R}}^{+})$ denotes the set of all continuous functions on ${\mathbb{R}}^{n}$ taking non-negative real values and which have compact support. I think it follows that $f(x)\ge 0$ for a.e. $x\in {\mathbb{R}}^{n}$. However I only managed to prove this implication in the case where $f$ is (essentially) bounded. How to go from this simpler case to the general case ?

${\int}_{{\mathbb{R}}^{n}}f(x)g(x)dx\ge 0$

for all $g\in {C}_{c}({\mathbb{R}}^{n},{\mathbb{R}}^{+}).$ Here ${C}_{c}({\mathbb{R}}^{n},{\mathbb{R}}^{+})$ denotes the set of all continuous functions on ${\mathbb{R}}^{n}$ taking non-negative real values and which have compact support. I think it follows that $f(x)\ge 0$ for a.e. $x\in {\mathbb{R}}^{n}$. However I only managed to prove this implication in the case where $f$ is (essentially) bounded. How to go from this simpler case to the general case ?