Suppose $g : [0,1] \to \mathbb R$ is bounded and measurable and $$\int_{0}^{1} f(x)g(x) dx=0$$ whenever $f$ is continuous and $$\int_{0}^{1} f(x) dx=0$$. Prove that $g$ is equal to a constant a.e.
I know for every measurable function g there is a continuous h in a compact support such that $$\int_{0}^{1}\mid(x)-h(x)\mid dx =0$$.I got stuck to go further.
You essentially consider some function $\tilde g(x) = g(x) - \frac{1}{b-a}\int_0^1 f(t) dt$. If you can show that $\tilde g(x) \equiv 0$, which is equivalent to showing that $\int_0^1 \tilde g(x) h(x) dx = 0$ for all $h$ continuous mapping $[0,1] \to \mathbb{R}$, then you're good to go!