If $\int_0^x f \ dm$ is zero everywhere then $f$ is zero almost everywhere I have been thinking on and off about a problem for some time now. It is inspired by an exam problem which I solved but I wanted to find an alternative solution. The object was to prove that some sequence of functions converges weakly to zero in $L^2$. 
I managed to show (with some help) that the limit $f$ (of a subsequence) satisfies $\int_0^x f \ dm=0$ for all $x>0 $. From this I want to conclude that $f=0$ a.e. I can do this with the fundamental theorem of calculus in its Lebesgue version but there ought to be a more elementary proof.
Can someone here help me out? 
 A: I think you can use Dynkin's lemma (if you call this "more elementary"). 
Let D be all the measurable sets $U\subseteq I=[0,1]$ such that $\intop_U f(t) = 0$ (the function $f\mid_I$ is in $L_2$ so it is also in $L_1$, so I assume this from now). $I\in D$ and if $A\subseteq B\subseteq I$ are in $D$ then $B-A \in D$. If $A_i \subseteq I$ is an increasing sequence in D then $\bigcup A_i \subseteq I$ is also in D (by the DCT). This shows that D is a Dynkin system.
Let P be all the open intervals in I (so $P\subseteq D$). P is not empty and an intersection of two open intervals are open, so P is closed under finite intersection, hence it is a pi system.
Dynkin's lemma says that if P is a pi system and D a dynkin system such that $P\subseteq D$ then $\sigma(P)\subseteq D$. The sigma algebra generated by P is the Borel algebra.
Now look on the set $A=\{x\in I \mid f(x)\geq 0\}$. This is a Lebesgue measurable set, so up to a zero measure set it is Borel measurable set $A'$. Since $\intop_{A'} f(t) = 0$ and f is non negative there, then f is zero almost every where in A'. The same argument work for when f<0, so you get that f is zero almost everywhere in $I$. Now do this for all of $n+I,\;n\in \mathbb{Z}$.
A: I believe here is an elementary proof (if you are willing to call dominated convergence theorem as elementary).
First a lemma:
Lemma: let $\displaystyle A$ be a bounded measurable set and let $\displaystyle  f \in L(A)$. If $A_n \subset A$ is a sequence of measurable sets such that
$$ A_1 \supset A_2 \supset A_3 \supset \dots$$
and $$\lim_{n \to \infty} m(A_n) = 0$$
then
$$\lim_{n \to \infty} \int_{A_n} f \ \text{dm} = 0$$
($\displaystyle m(T)$ is the lebesgue measure of $\displaystyle T$).
Proof:
It is well known (and has an elementary proof) that $\displaystyle X  = \bigcap_{n=1}^{\infty} A_n$ is measurable and $\displaystyle m(X) = \lim_{n \to \infty} m(A_n) = 0$.
Now define a sequence of (summable) functions
$\displaystyle f_n(x) = 
\begin{cases} 2 f(x) & x \in A_n \\
f(x) & \text{otherwise}
\end{cases}$
Now $\displaystyle |f_n(x)| \le |2f(x)|$ and $f_n \to f$ almost everywhere.
The set of points $\displaystyle S$ where $f_n(x) \to f(x)$ is not true, satisfies $\displaystyle S \subset X$ and hence is measurable and $\displaystyle m(S) = 0$.
By the dominated convergence theorem we have that
$$\lim_{n \to \infty} \int_{A} f_n = \int_{A} f$$
But we have that
$$\int_{A} f_n = \int_{A} f + \int_{A_n} f$$
Thus 
$$\lim_{n \to \infty} \int_{A_n} f = 0$$
$\displaystyle \circ$
Note that if $\displaystyle f$ was bounded, then there is a much simpler proof of the above lemma, which does not make use of the dominated convergence theorem.
Now back to the original problem.
Let $\displaystyle P_n = \{ x : f(x) \ge \frac{1}{n} \}$.
If the set $\displaystyle P = \{x : f(x) \gt 0\} = \bigcup P_n$ is of positive measure, then there is an $\displaystyle n$ for which  $\displaystyle m(P_n) \gt 0$. Now if $\displaystyle P_n$ is unbounded, there is some $\displaystyle M$ for which $\displaystyle m(P_n \cap [M, M+1]) \gt 0$. Call that set $\displaystyle A$.
Notice that $\displaystyle \int_{A} f \ge \frac{m(A)}{n} \gt 0$.
Now give an integer $\displaystyle k \gt 0$, there is an open set $\displaystyle G_k \supset A$ such that $\displaystyle m(G_k-A) \lt \frac{1}{k}$.
Note that we can choose the $\displaystyle G_i$ such that $\displaystyle G_1 \supset G_2 \supset G_3 \supset \dots$, by taking $\displaystyle G'_k = \bigcap_{i = 1}^{k} G_i$.
Now the sequence of sets $\displaystyle A_k = G'_k -A$ satisfies the conditions of the above lemma,
we also have
$$\int_{G'_k} f = \int_{A} f + \int_{A_k} f$$
Now since $\displaystyle G'_{k}$ is a countable union of intervals, we have that $\displaystyle \int_{G'_k} f = 0$, since over every interval, the integral of $\displaystyle f$ is $\displaystyle 0$.
Thus
$$\int_{A} f + \int_{A_k} f = 0$$
Taking limits, and applying above lemma, we get
$$\int_{A} f = 0$$
A contradiction. Similarly, we can show that negative set of $\displaystyle f$ is of measure $\displaystyle 0$ (or just consider $\displaystyle -f$).
Hence $\displaystyle f = 0 \ \text{a.e}$

Note: Since this answer almost proves two claims made by other answers, I am including a sketch of proof of those here:
Claim 1) For any measurable set $\displaystyle A$, there is a Borel Set $\displaystyle B \supset A$ such that $\displaystyle m(B) = m(A)$.
For a proof of that, consider the $\displaystyle G'_{k}$ above. $\displaystyle B = \bigcap_{k=1}^{\infty} G'_{k}$ is a Borel set such that $\displaystyle m(B) = m(A)$, as $\displaystyle m(B) = \lim_{k \to \infty} m(G'_{k}) = m(A)$.
Claim 2) For the $\displaystyle f$ in the problem, for any Borel set $\displaystyle B$, $\displaystyle \int_{B} f = 0$.
The proof above actually shows that for any measurable set $\displaystyle E$, $\displaystyle \int_{E} f = 0$.
A: Indeed, as you expected, a simple proof of the result can be found; see Theorem 2.1 in this useful note on absolutely continuous functions.
EDIT: Since this is a quite important result, it is worth giving here the proof in detail. The proof below is essentially the one given in the link above, but somewhat shorter.
Theorem. If $f$ is integrable on $[a, b]$ and $\int_a^x {f(t) dt}  = 0$ $\forall x \in [a,b]$, then $f = 0$ a.e. on $[a, b]$.
Proof. An open subset $O$ of $[a,b]$ is a countable union of disjoint open intervals $(c_n, d_n)$; hence,
$$ \int_O {f(t) dt}  = \sum\limits_{n = 1}^\infty  {\int_{c_n }^{d_n } {f(t) dt} }  = 0 $$.
If $K$ is a closed subset of $[a,b]$, then
$$ \int_K {f(t) dt}  = \int_a^b f(t)dt - \int_{(a, b) \setminus K} f(t)dt = 0 - 0 = 0, $$
since $ (a, b) \setminus K $ is open.
Next let $E_ +   = \{ x \in [a,b]:f(x) > 0\}$ and $E_ -   = \{ x \in [a,b]:f(x) < 0\}$. If $\lambda(E_+) > 0$, then there exists some closed set $K \subset E_+$ such that $\lambda(K) > 0$. But $\int_K {f(t){\rm d}t}  = 0$, hence $f=0$ a.e. on $K$. This contradiction shows that $\lambda(E_+) = 0$. Similarly, $\lambda(E_-) = 0$. The theorem is thus established.
A: It is sufficient to prove that $f$ is zero almost everywhere on any bounded interval. 
(1) By additivity it is easy to see that $$\int_a^bf(x)dx=\int_0^bf(x)dx - \int_0^af(x)dx$$ for all bounded intervals $(a,b)$ (and also for $[a,b)$, $(a,b]$ and $[a,b]$). 
(2) Using (1) it is easy to see that $$\int_Bf(x)dx=0$$ for any bounded Borel measurable set.
(3) Any Lebesgue measurable set $A$ is of the form $A=B\cup Z$ where $B$ is a Borel measurable set and $Z$ is a set of measure zero. Hence, by (2) we acheive
$$\int_A f(x)dx= 0$$
for any bounded Lebesgue measurable set $A$. 
(4) Now look at the sets $A_+(n)=\{x:f(x)>0\}\cap[-n,n]$ and $A_-(n)=[-n,n]\setminus A_+(n)$. Assuming $f$ is measurable these sets are also measurable and by (3) 
$$\int_{A_\pm(n)}f(x)dx=0$$
EDIT: and hence $f=0$ almost everywhere.
Please forgive me if I write $dx$ for the Lebesgue measure which I presume is what you refer to as $dm$. 
A: If $F(x)=\int_0^x f(t) dt=0$ everywhere, then $F'(x)=0$ for all $x$. Since $f$ is locally integrable, $F'(x)=f(x)$ almost everywhere. Hence $f(x)=0$ almost everywhere.
A: Here is yet another argument. The only (somewhat) non-elementary fact that I use is that for each $f \in L^1 ([0,A])$ and $\varepsilon > 0$, one can find a continuous, compactly supported function $g \in C_c(\Bbb{R})$ with $\mathrm{supp} \, g \subset [0,A]$ such that $\| f - g\|_{L^1([0,A])} < \varepsilon$.
Without loss of generality, I can assume that $f$ is real-valued (otherwise, apply the argument below to the real and imaginary part separately).
As others have already noted, we have $\int_a^b f(x) \, d x = \int_0^b f(x) \, d x - \int_0^a f(x) \, dx = 0$ for any $a \leq b$. This implies that $\int_\Omega f(x) \, d x = 0$ for any set $\Omega \subset \Bbb{R}$ which is a countable, disjoint union of intervals.
It is not hard to see that this holds for every open set $\Omega \subset \Bbb{R}$. In case you don't want to read through the linked question, I provide a short proof below.
It is enough to prove that $f = 0$ almost everywhere on $[0,A]$, for fixed but arbitrary $A > 0$. Suppose this is not so; then $\varepsilon := \|f\|_{L^1([0,A])} > 0$, so that by the property mentioned above there is a function $g \in C_c (\Bbb{R})$ with $\mathrm{supp} \, g \subset [0,A]$ such that $\| f - g\|_{L^1([0,A])} < \varepsilon / 4$.
Note that $\Omega := \{ x : g(x) > 0 \}$ is open, and $\Omega \subset [0,A]$. Hence,
$$
\bigg| \int_\Omega g(x) \, dx \bigg|
= \bigg| \int_\Omega g(x) - f(x) \, d x \bigg|
\leq \int_0^A |g(x) - f(x)| \, d x
\leq \frac{\varepsilon}{4}.
$$
In exactly the same way, we also get $|\int_{\Omega'} g(x) \, d x| \leq \varepsilon / 4$ for $\Omega' := \{x \colon g(x) < 0\}$.
Therefore, $\|g\|_{L^1([0,A])} \leq \varepsilon / 2$, so that
$\varepsilon = \|f\|_{L^1([0,A])} \leq \|f - g\|_{L^1} + \|g\|_{L^1} \leq \frac{3}{4} \varepsilon$, which is the desired contradiction.

Proof that each open set is the countable disjoint union of open intervals:
Each set $\Omega \subset \Bbb{R}$ is the disjoint union of its connected components, each of which is (in the case of an open set $\Omega$) an open interval; furthermore, since $\Bbb{R}$ is separable, any collection of disjoint, non-empty open sets has to be countable. (Slightly different argument: Each of the connected components $I \subset \Omega$ contains a rational number $q_I \in I$, and $q_I \neq q_J$ for $I \neq J$, since the components are disjoint; hence, the map $I \mapsto q_I$ is injective from the set of connected components of $\Omega$ into the rational numbers).
