$\mathbb{E}[f \mathbb{1}_{[0,\theta]}]=0$ for all $\theta \geq 0$ implies that $f=0$ almost surely? my question is essentially in the title.
Do we have for a function on the nonnegative real line, if for all $\theta\geq 0$ we have
$$
\mathbb{E}[f \mathbb{1}_{[0,\theta]}]=0
$$
then $f$ must be $0$ almost surely?
I would think so since the intervals $[0,\theta]$ generate the Borel sigma algebra for the nonnevative real numbers but I can't find the rigorous argument.
Any tips on this?
Thanks in advance.
 A: It seems that in the setting of the question, we assume that for each $t\geqslant 0$,
$$
\tag{*}\int_{[0,t)}f(x)g(x)dx=0
$$
where $g$ is a non-negative integrable function and $f$ is such that $\int_{[0,t)}\lvert f(x)\rvert g(x)dx$ is finite for each $t$.
First, (*) can be extended to finite disjoint union of open intervals, then to countable disjoint unions of such intervals. Any open set can be expressed as a countable disjoint union of disjoint intervals. Consequently, for each open set $O$,
$$\tag{**}
\int_{O}f(x)g(x)dx=0.
$$
Define the measure
$$
\mu\colon B\mapsto \int_{B}\lvert f(x)\rvert g(x)dx.
$$
For any fixed $R$, $\mu$ is a finite measure on $[0,R]$. One can show that the collection of sets
$$
\mathcal A:=\left\{B\in\mathcal B([0,R]):\forall\varepsilon>0, \exists F\mathrm{ closed, }O \mathrm{ open }, O\subset B\subset F, \mu(F\setminus O)<\varepsilon\right\}
$$
it a $\sigma$-algebra containing open sets. Using this, we extend (**) to Borel sets and we conclude that $f=0$ a.s. for the measure having density $g$.
