Integral absolute value proof

Using the hint from the comments sections we can provide a nice proof.

If we assume $f$ is a Riemann-integrable function, this inequality is true, we will provide a proof.

Proof

By properties of absolute value, we get $$-|f(x)|\le f(x)\le |f(x)|.$$ Since $f$ is continuous, we know that $|f|$ is also continuous, hence $|f|$ is Riemann integrable. We can integrate each side of this inequality and we get $$-\int_a^b |f(x)|dx\le \int_a^bf(x)dx\le \int_a^b|f(x)|dx$$ This instantly gives us that: $$\left| \int_a^b f(x)dx\right|\le \int_a^b|f(x)|dx. $$ $\square$

Alternatively, you are considering a continuous version of the triangle inequality. The very definition of an integral is the limit of discrete sums of (Riemann) intervals. To properly prove this from the definition we must go back to the definition of integration: For any Riemann sum we get from the usual triangle inequality for the absolute value:

$$\left|\sum_{k=1}^nf(c_i)(x_i-x_{i-1})\right|\leq\sum_{k=1}^n|f(c_i)|(x_i-x_{i-1})\,\,,\,$$

$$\{a=x_0<x_1<...<x_n=b\}\,\,,\,\,c_i\in[x_{i-1},x_1]$$

Pass now to the limit $\,n\to\infty\,$ while the maximal length of the subintervals goes to zero (this is what is done to get the Riemann integral from Riemann sums). With courtesy of: The triangle inequality for integrals


Hint: a) If $f$ is a step function, then the inequality follows very easily. b) If $f$ is a regulated function (or a continuous function), use the fact that you can approximate $f$ w.r.t. $\| \cdot \|_\infty$ by a sequence $\{f_n\}$ of step functions. Now use part a).