Show that $f = 0$ almost everywhere $f$ be an integrable function (not necessarily positive) on [0,1]. Assume that for any $g$ measurable bounded function $g:[0,1] \rightarrow \mathbb{R}$ we have $$\int_{[0,1]} g(t)f(t)dt = 0$$ Prove $f=0$ a.e

I understand that $|g| \leq M$ for some $M>0$ and that the measure of the integration is finite but I have a hard time dealing with $f$ being non-negative here. 
 A: Take $g = 1_{\{f \geq 0\}}$ and $g = 1_{\{f < 0\}}$ (show that they are measurable and bounded).
Using these two functions, you get two integrals of the form $\int_A f(t) dt=0$. In both integrals, you know the sign of $f$, which solves your problem.
A: We will prove: if $(X,\mu)$ is a measure space, $f$ an integrable function $X \to \mathbb{R}$, and $\forall E \subseteq X$ measurable, $\int_E f d\mu= 0$, then $f =0$ $\mu$-a.e.
Suppose not $f = 0$ $\mu$ a.e. Claim: there exists $n$ s.t. $\{x \in X \mid |f|(x) > 1/n\}$ does not have $\mu$ measure $0$.
Proof (sketch): Suppose each did, write $S = \{x \in X \mid |f|(x) \neq 0\}$ as a countable union of the above sets. Countable union of null sets is null, hence $S$ is $\mu$-null contradicting the assumption that not $f=0$ a.e. 
Let $E= \{x \in X \mid |f|(x) > 1/n\}$ for some $n$ s.t. $\mu(E) > 0$. Decompose $f = f_+ - f_-$ where $f_+ =\max(0, f)$, $f_- = \max(0, -f)$. Then $E = |f|^{-1}((1/n,\infty)) = f_+^{-1}((1/n,\infty)) \cup f_-^{-1}((1/n,\infty)).$, so one of the two $f_+^{-1}((1/n,\infty)), f_-^{-1}((1/n,\infty))$ must not be $\mu$-null. Suppose $\mu(f_+^{-1}((1/n,\infty)))>0$. Then $\int_{f_+^{-1}((1/n,\infty))} f d\mu > \int 1/n d\mu = 1/n \mu(f_+^{-1}((1/n,\infty)))> 0$. Otherwise suppose $\mu(f_-^{-1}((1/n,\infty))) >0$. Then $\int_{f_-^{-1}((1/n,\infty))} f < \int_{f_-^{-1}((1/n,\infty))} -1/n = -1/n \mu(f_-^{-1}((1/n,\infty))) < 0$.
In either case we have found a meaurable set s.t. $\int_E f \neq 0$. Hence $\int_E  f = 0 $ for all measurable sets implies $f = 0$ a.e.
Convince yourself my result implies yours.
