Showing that $f = 0 $ a.e. if for any measurable set $E$, $\int_E f = 0$

Let $(X, \mathcal{B}, \mu)$ be a measure space and $f$ a measurable function on $X$ and suppose that $\forall E \in \mathcal{B}$ we have that $\int_E f = 0$. Then I want to show that $f = 0$ almost everywhere (a.e.).

  1. Suppose for sake of contradiction that $f \ne 0$ a.e.
  2. Then $\not\exists E \in \mathcal{B}$ s.t. $\mu(E) = 0$ and $f(x) = 0$, $\forall x \in X – E$
  3. Then $\{x : f(x) \ne 0\} = A$ is not measure zero so that either $\mu(A) > 0$ or $A \notin \mathcal{B}$.

  4. Now if $\mu(A) > 0$ then it is easy to see that $\int_A f \ne 0$ so that we have a contradiction of our original hypothesis that $\forall E \in \mathcal{B}, \int_E f = 0$.

  5. But if on the other hand $A \notin \mathcal{B}$, I cannot no longer appeal to $\int_A f \ne 0$ since $\int_A f$ is non-sense. So I’m having trouble with this part of the argument.

Solutions Collecting From Web of "Showing that $f = 0 $ a.e. if for any measurable set $E$, $\int_E f = 0$"

Arguing by contradiction definitely works, here’s the idea.

Let $\mu(\{ x : f(x) \neq 0 \}) > 0$.

Then we have $\{x : f(x) \neq 0\} = \{x : f(x) > 0\} \cup \{x : f(x) < 0\}$, so we must have one of these two sets have positive measure.

Let’s say its the first one (the argument for the second is analogous).

Then $\{x : f(x) > 0\} = \bigcup \{ x : f(x) \geq \frac{1}{n}\} = \bigcup E_n$ so again one of these must have positive measure.

So say $E_k$ has positive measure, then $f$ dominates $\frac{1}{k}$ on $E_k$ so $$\int_{E_k} f \geq \int_{E_k} \frac{1}{k} = \mu(E_k)\frac{1}{k} > 0.$$ So we have a contradiction.

EDIT: also, to comment on your proof: as you see here we don’t need to deal with whether or not $A$ is measurable, it definitely is. And also, for step $4$ of your proof $\mu(A) > 0$ does not imply that $\int_A f \neq 0$ for example if $f = 1_{(0,1)} – 1_{(-1,0)}$

The set $\{x:f(x)\neq 0\}$ is the same as $f^{-1}\big((-\infty,0)\big)\cup f^{-1}\big((0,\infty)\big)$ and therefore measurable. So the issue in 5. never occurs.

And I think you should be more explicit in step 4.