Let $f \in L^{1}(X)$ and $g:X \to \mathbb{R}$ measurable, such $f=g$ a.e. Prove that $g \in L^{1}(X)$ and $\int_{X} f d \mu = \int_{X} g d \mu $.
I already proved the following lemma:
Lemma
If $f,g:X \to \mathbb{R}$ are integrable. we have that $f=g$ a.e if and only if $\int_{A} f d \mu = \int_{A} g d \mu$ for every $A\in \mathcal{M}_{X}$ where $\mathcal{M}_{X}$ is the corresponding sigma algebra.
I dont know if I can use this lemma to prove the first statement, since what I need to prove is that
$\int |g| d \mu< +\infty$.
My attempt of proof goes as follows:
If $f=g$ a.e, then $|f|=|g|$ a.e. So $\int |g| d \mu=\int |f| d \mu< \infty$ as $f \in L^{1}$ so g \in L^{1}(X).
I got the feeling im kind of lost proving this. Any help completing the proof will be apreciated
Maybe you can introduce the measurable function $h:X\to \mathbb{R}$ such that $h(x)=f(x)-g(x)$ for all $x\in X$, and deduce that $h=0$ a.e. in $X$. Then show that $h$ is integrable with $\int_X h\,dx=0$, and use the additivity of Lebesgue integral that $$\int_X g\,dx=\int_X (f-h)\,dx=\int_X f\,dx-\int_Xh\,dx=\int_X f\,dx.$$