Proof (integral of absolute value)
First we show that $\sup_I |f| - \inf_I |f| \leq \sup_I f - \inf_I f$. We have three cases:
-
if $f(x) \geq 0$ for all $x$, then $|f| = f$ so $\sup_I |f| - \inf_I |f| = \sup_I f - \inf_I f$.
-
If $f(x) \leq 0$ for all $x$, then $|f| = -f$ so $$ \begin{align*} \sup_I|f| - \inf_I |f| = \sup_I(-f) - \inf_I(-f) = -\inf_I f + \sup_I f \end{align*} $$ where the second step uses this.
-
Otherwise, $\inf_I f < 0$ and $\sup_I f > 0$. Then $$ \begin{align*} \sup_I|f| - \inf_I|f| &\leq \sup_I |f| \\ &= \sup_I \max\set{f,-f} \\ &= \max\set{\sup_I f, \sup_I(-f)} \\ &= \max\set{\ub{\sup_I f}_{\geq 0}, \ub{-\inf_I f}_{\geq 0}} \\ &\leq \sup_I f - \inf_I f. \end{align*} $$
This implies that for any dissections $\mathcal{D}$, $U(|f|,\mathcal{D}) - L(|f|, \mathcal{D}) \leq U(f,\mathcal{D}) - L(f,\mathcal{D})$.
Since $f$ is integrable, by Cauchy criterion, for all $\epsilon>0$, there exists a dissection $\mathcal{D}$ such that $$ \begin{align*} \epsilon > U(f,\mathcal{D}) - L(f,\mathcal{D}) \geq U(|f|, \mathcal{D}) - L(|f|, \mathcal{D}) \end{align*} $$ so $|f|$ is integrable by Cauchy criterion.
Besides $$ \begin{align*} -|f(x)| \leq f(x) \leq |f(x)| \quad \forall x, \end{align*} $$ so applying integrals gives $$ \begin{align*} -\int_{a}^{b} |f| \leq \int_{a}^{b} f \leq \int_{a}^{b} |f| \implies \left|\int_{a}^{b} f \right| \leq \int_{a}^{b} |f|. \end{align*} $$