Does equality of antiderivatives imply equality almost everywhere? If two Lebesgue integrable functions   $\,f,g:[a,b]\to \mathbb R\,$ satisfy 
$$
\int_a^x f(s)\,ds= \int_a^xg(s)\,ds,
$$
for every  $\, x\in[a,b],\,$  then is is it true that $ f(x)=g(x)$  almost everywhere?
Note
The converse is true: if two integrable functions agree almost everywhere, then their integrals over any interval are equal.  (In fact, integrals over any set are equal).
 A: We prove if $f$ be Lebsegue integrable on $[a, b]$ which satisfies
$$\int_a^c fd\mathcal{L}^1 =0,$$
for every $c$. Show that $f$ is equal to $0$ a.e..

We can define two measures $m_+, m_−$ on $[a, b]$ by
$$m_+(E) =\int_E f^+d\mathcal{L}^1, m_-(E) =\int_E f^-d\mathcal{L}^1$$
Using $\int_a^c fd\mathcal{L}^1= m_+((a, c)) − m_−((a, c)) = 0$, we can see that $m_+(I) = m_−(I)$, for every open interval $I \subset [a, b]$. Since every open set can be represented as a countable union of disjointed intervals, one has that $m_+(O) = m_−(O)$, for every open set $O \subset [a, b]$. Since Borel sets are generated by open sets, this holds for every Borel, and hence measurable sets $E$. This shows that $\int_Efd\mathcal{L}^1 = m_+(E) − m_−(E) = 0$.
Setting $E=\{x\in[a,b]|f(x)\geq 0\}$, we have $f^+ =0$. Similarly $f^− =0$. Hence $f = 0$ a.e.

If they are not Lebesgue integrable, the result is not true. Consider $[a,b]=[0,1]$, where $f(x)=\frac{1}{x},g(x)=\frac{1}{2x} \forall x\in (0,1], f(0)=g(0)=0$, 
The integral is always $\infty$, but $f,g$ are not equal a.e..
A: It suffices to show that:


*

*If $\,\,f\in L^1[a,b]\,\,$ and $\,\,\displaystyle\int_a^x f(s)\,ds=0,\,\,$ for all $\,x\in[a,b],\,$ then $\,f=0\,$ a.e.


Set $\mu(E)=\int_E f(s)\,ds.\,$ Then $\mu$ defines a signed measure in $[a,b]$. We know that $\mu(F)=0$, for all subintervals $F$ of $[a,b]$. In particular $\mu(U)=0$, for all $U$ open in $[a,b]$, as they are countable unions of intervals. 
Let now $\lambda,\nu$ be two signed-measures on $\mathscr B([a,b])$, the Borel subsets of $[a,b]$. Clearly, if $\lambda([a,b])=\mu([a,b])$, then the collection of sets
$$
\mathscr S=\{E\in\mathscr B([a,b]): \lambda(E)=\nu(E)\},
$$
is a $\sigma$-algebra.
In our case $\mu$ agrees with the identically zero measure on the open sets of $[a,b]$, and hence on the $\sigma$-algebra they generate, which is $\mathscr B([a,b])$. Thus
$$
0=\mu(E)=\int_E f(x)\,dx,
$$
for all $\,E\in\mathscr B([a,b])$. Let $A=\{x\in[a,b]: f(x)\ge 0\}$ and $B=\{x\in[a,b]: f(x)< 0\}$. Then $A$ and $B$ are Borel sets and 
$$
\int_A f(x)\,dx=\int_B f(x)\,dx=0.
$$
But as $f(x)\ge 0$ and $\int_A f(x)\,dx=0$, then $f(x)=0$ a.e. in $A$, and so happens in $B$. Thus $f(x)=0$ a.e. in $[a,b]$.
