I am reading "Measure, Integration & Real Analysis" by Sheldon Axler.
3.16 additivity of integration
Suppose $(X,\mathcal{S},\mu)$ is a measure space and $f,g:X\to [0,\infty]$ are $\mathcal{S}$-measurable functions. Then $$\int (f+g) d\mu=\int f d\mu+\int g d\mu.$$
3.18 Definition integral of a real-valued function
Suppose $(X,\mathcal{S},\mu)$ is a measure space and $f:X\to [-\infty,\infty]$ is an $\mathcal{S}$-measurable function such that at least one of $\int f^+ d\mu$ and $\int f^- d\mu$ is finite. The integral of $f$ with respect to $\mu$, denoted $\int f d\mu$, is defined by $$\int f d\mu=\int f^+ d\mu-\int f^- d\mu .$$
I will prove the following propostion.
My Proposition
Suppose $(X,\mathcal{S},\mu)$ is a measure space and $f:X\to [-\infty,\infty]$ is an $\mathcal{S}$-measurable function. Then $f^+:X\to [0,\infty]$ and $f^-:X\to [0,\infty]$ are $\mathcal{S}$-measurable functions.
Proof
Let $B\subset [0,\infty]$ be a Borel set.
If $0\notin B$, then $$(f^+)^{-1}(B)=\{x\in X:0\leq f(x)\}\cap\{x\in X:f(x)\in B\}\\=f^{-1}([0,\infty])\cap f^{-1}(B).$$
Since $f$ is an $\mathcal{S}$-measurable function, $f^{-1}([0,\infty]),f^{-1}(B)\in\mathcal{S}$.
So, $(f^+)^{-1}(B)\in\mathcal{S}.$
If $0\in B$, then $$(f^+)^{-1}(B)=\left(\{x\in X:0\leq f(x)\}\cap\{x\in X:f(x)\in B\}\right)\cup\{x\in X:f(x)<0\}\\=\left(f^{-1}([0,\infty])\cap f^{-1}(B)\right)\cap f^{-1}([-\infty,0)).$$
Since $f$ is an $\mathcal{S}$-measurable function, $f^{-1}([0,\infty]),f^{-1}(B),f^{-1}([-\infty,0))\in\mathcal{S}$.
So, $(f^+)^{-1}(B)\in\mathcal{S}.$
Thereofore, $f^+$ is an $\mathcal{S}$-measurable function.
Similary, we can prove that $f^-$ is an $\mathcal{S}$-measurable function.
3.21 additivity of integration
Suppose $(X,\mathcal{S},\mu)$ is a measure space and $f,g:X\to\mathbb{R}$ are $\mathcal{S}$-measurable functions such that $\int |f|d\mu<\infty$ and $\int |g|d\mu<\infty$. Then $$\int (f+g)d\mu=\int f d\mu+\int g d\mu.$$
Proof Clearly $$\begin{align*} \begin{aligned} (f+g)^+ - (f+g)^-&=f+g\\&=f^+-f^-+g^+-g^-. \end{aligned} \end{align*}$$
Thus $$(f+g)^++f^-+g^-=(f+g)^-+f^++g^+.$$
Both sides of the equation above are sums of nonnegative functions. Thus integrating both sides with respect to $\mu$ and using 3.16 gives $$\int (f+g)^+d\mu+\int f^-d\mu+\int g^-d\mu=\int (f+g)^-d\mu+\int f^+d\mu+\int g^+d\mu.$$
Rearranging the equation above gives $$\int (f+g)^+d\mu-\int (f+g)^-d\mu=\int f^+d\mu-\int f^-d\mu+\int g^+d\mu-\int g^-d\mu,$$
where the left side is not of the form $\infty-\infty$ because $(f+g)^+\leq f^++g^+$ and $(f+g)^-\leq f^-+g^-$. The equation above can be rewritten as $$\int (f+g)d\mu=\int f d\mu+\int g d\mu,$$ completing the proof.
I don't perfectly understand what the author wants to say in the above proof.
In the above proposition, all of $\int f^+d\mu,\int f^-d\mu,\int g^+d\mu,\int g^-d\mu,\int (f+g)^+d\mu$ and $\int (f+g)^-d\mu$ are real numbers.
So, we can rearrange the equation in the above proof.
Does the author want to say this?
I rewrote the above proof for me as follows:
My Proof
Since $\int |f|d\mu=\int (f^++f^-)d\mu=\int f^+d\mu+\int f^-d\mu<\infty$, $\int f^+d\mu,\int f^-d\mu\in\mathbb{R}$.
Since $\int |g|d\mu=\int (g^++g^-)d\mu=\int g^+d\mu+\int g^-d\mu<\infty$, $\int g^+d\mu,\int g^-d\mu\in\mathbb{R}$.
We prove that $(f+g)^+\leq f^++g^+$ and $(f+g)^-\leq f^-+g^-$ hold.
If $(f+g)(x)<0$, then $(f+g)^+(x)=0\leq f^+(x)+g^+(x).$
We consider the case in which $(f+g)(x)\geq 0$.
If $f(x)\geq 0$ and $g(x)\geq 0$, then $(f+g)^+(x)=f(x)+g(x)=f^+(x)+g^+(x).$
If $f(x)\geq 0$ and $g(x)<0$, then $(f+g)^+(x)=f(x)+g(x)<f(x)+0=f^+(x)+g^+(x).$
If $f(x)<0$ and $g(x)\geq 0$, then $(f+g)^+(x)=f(x)+g(x)<0+g(x)=f^+(x)+g^+(x).$
So, $(f+g)^+\leq f^++g^+.$
Similarly, we can prove that $(f+g)^-\leq f^-+g^-.$
So, $\int (f+g)^+d\mu\leq\int f^+d\mu+\int g^+d\mu<\infty$.
Similarly, $\int (f+g)^-d\mu<\infty$.
Therefore, $\int (f+g)^+d\mu,\int (f+g)^-d\mu\in\mathbb{R}.$
Clearly $$\begin{align*} \begin{aligned} (f+g)^+ - (f+g)^-&=f+g\\&=f^+-f^-+g^+-g^-. \end{aligned} \end{align*}$$
Thus $$(f+g)^++f^-+g^-=(f+g)^-+f^++g^+.$$
Both sides of the equation above are sums of nonnegative functions. Thus integrating both sides with respect to $\mu$ and using 3.16 gives $$\int (f+g)^+d\mu+\int f^-d\mu+\int g^-d\mu=\int (f+g)^-d\mu+\int f^+d\mu+\int g^+d\mu.$$
We can rearrange the equation above because all of $\int f^+d\mu,\int f^-d\mu,\int g^+d\mu,\int g^-d\mu,\int (f+g)^+d\mu$ and $\int (f+g)^-d\mu$ are real numbers.
Rearranging the equation above gives $$\int (f+g)^+d\mu-\int (f+g)^-d\mu=\int f^+d\mu-\int f^-d\mu+\int g^+d\mu-\int g^-d\mu.$$
The equation above can be rewritten as $$\int (f+g)d\mu=\int f d\mu+\int g d\mu,$$ completing the proof.
Is the above proof of mine ok?