# If $\int_E f=\int_E g$ then $f=g$ a.e.?

Is the converse of the following statement is true?

Let $f$ and $g$ be two bounded measurable functions on a set $E$. If $f(x)=g(x)$ a.e. on $E$ then $$\int_E f=\int_E g$$

Here is my proof for converse but my textbook says give an example that the converse statement does not hold.

Let $A_1=\{x|f(x)>g(x)\}$ and $A_2=\{x|f(x)<g(x)\}$

$A_1\cup A_2=\{x|f(x)\not=g(x)\}$

Suppose $m(A_1)>0, \,\,\, A_1=\bigcup_{n=1}^\infty E_n$

Therefore there exists $n, \,\,\, m(E_n)>0$

$E_n=\{x|f(x)-g(x)\geq\frac{1}{n}\} \,\,\,\, f-g$ is measurable therefore $E_n$ is measurable.

$\int_{E_n}f-\int_{E_n}g=\int_{E_n}f-g\geq\frac{1}{n}mE_n>0\,\,\,$ contradiction.

Similarly if $m(A_2)>0$ we get a contradiction.

• Dear @user117890: You reason very well until the line where you claim a contradiction. Notice that there is no contradiction if the integral of $f$ is strictly greater than that of $g$ on some proper subset of $E$. All the best. – Jared Dec 16 '14 at 7:11
• Take any two different cdfs on the same space for a counter example. – copper.hat Dec 16 '14 at 7:55
• It would be more interesting to prove the following : If for every open subset $F$ of the open set $E$ we have $\int_Ff=\int_Fg$ then we have $f=g$ a.e. on $E$. – Tom-Tom Dec 16 '14 at 11:01

Why do you claim a contradiction in the last two lines? The hypothesis is that $$\int_E f = \int_E g$$ but it need not be the case that $$\int_{E_n} f = \int_{E_n} g$$ Consider, for example, $E = [0,2\pi]$, $f(x) = \cos(x)$, and $g(x) = \sin(x)$. Then $\int_E f = \int_E g = 0$ but, for example, $\int_0^\pi f \neq \int_0^\pi g$.
Consider $f(x)=x$ and $g(x)=1-x$ on $E=[0,1]$.