Prove $|\int_{B}^{} f|\leq \int_{B}^{} |f|\ $ using defition of integral. I'm trying to prove the below equation:
If $f: B \rightarrow \mathbb{R}$ and $|f|$ are integrable then, $|\int_{B}^{} f|\leq \int_{B}^{} |f|\ $.
I'm trying to use the definition of integral but couldn't succeed.
 A: For any definition of integral, you have $f\leqslant g\implies\int_B f\leqslant\int_B g$ and $\int_B-f=-\int_Bf$. Therefore\begin{align}-|f|\leqslant f\leqslant|f|&\implies\int_B-|f|\leqslant\int_Bf\leqslant\int_B|f|\\&\iff-\int_B|f|\leqslant\int_Bf\leqslant\int_B|f|\\&\iff\left|\int_Bf\right|\leqslant\int_B|f|.\end{align}
A: Preassume that integral $\int g$ is defined for any nonnegative measurable function $g$. This with $\int g\in[0,\infty]$ and $\int g_1+g_2=\int g_1+\int g_2$.
Function $f:B\to\mathbb R$ induces nonnegative functions $f_+:B\to\mathbb R$ prescribed by $x\mapsto\max(f(x),0)$ and $f_-:B\to\mathbb R$ prescribed by $x\mapsto\max(-f(x),0)$.
Further $f$ is measurable if and only if $f_+$ and $f_-$ are both measurable, and we have $f=f_+-f_-$ and $|f|=f_++f_-$.
$\int f$ is defined if $\int f_+<\infty$ or $\int f_-<\infty$, and if so then:$$\int f=\int f_+-\int f_-\text{ by definition! }\tag1$$
Further we have $$\int |f|=\int f_++\int f_-\tag2$$
Note that here $\int f_-$ and $\int f_+$ are nonnegative.
Then the inequality $|\int f_+-\int f_-|\leq\int f_++\int f_-$ tells us that $|\int f|\leq\int|f|$.
