Show that if $f$ is integrable on $[a,b]$, then $|f|$ is also integrable.

It is enough to show that if $I$ is any subinterval of $[a,b]$, then $$\sup_I\vert f\vert-\inf_I\vert f\vert\leq \sup_I f-\inf_I f\, . $$ If this is done then, given any partition $P$, apply this inequality to each interval $I$ of the partition, multiply by $\vert I\vert$ and sum everything to get $U(P,\vert f\vert)-L(P,\vert f\vert)\leq U(P,f)-L(P,f)$.

So let us fix the interval $I$. One may distinguish 3 cases.

  1. If $\inf_I f\geq 0$, then $f\geq 0$ on $I$ so $\inf_I \vert f\vert=\inf_I f$ and $\sup_I\vert f\vert =\sup_I f$ and hence $\sup_I\vert f\vert-\inf_I\vert f\vert= \sup_I f-\inf_I f$.

  2. If $\sup_I f\leq 0$, then $f\geq 0$ on $I$, so $\inf_I \vert f\vert=-\sup_I f$ and $\sup_I\vert f\vert =-\inf_I f$ and hence $\sup_I\vert f\vert-\inf_I\vert f\vert= \sup_I f-\inf_I f$ again.

  3. If $\inf_I f<0<\sup_I f$, then we have either $\sup_I\vert f\vert=\sup_I f$, in which case $\sup_I\vert f\vert-\inf_I\vert f\vert\leq \sup_I\vert f\vert=\sup_I f<\sup_I f-\inf_I f$; or $\sup_I \vert f\vert=-\inf_I f$, in which case $\sup_I\vert f\vert-\inf_I\vert f\vert\leq -\inf_I f< \sup_I f-\inf_I f$.


I can propose the following very own proof. :-) Since $f$ is (properly) Riemann integrable on $[a,b]$, $f$ is bounded on $[a,b]$. By Lebesgue theorem, a bounded function $f$ on a segment is Riemann integrable iff the set $D(f)$ of the discontinuity points of $f$ has the Lebesgue measure $0$. Since the function $|\cdot|$ is continuous, $D(|f|)\subset D(f)$. Thus $0\le\mu(D(|f|))\le \mu(D(f))\le 0$ and again by Lebesgue thereom, the function $|f|$ is Riemann integrable on $[a,b]$.


Recall Darboux's Criterion: $f: [a,b] \rightarrow \mathbb{R}$ is Riemann(-Darboux) integrable iff for all $\epsilon > 0$, there is a partition $\mathcal{P} = \{a = x_0 < x_1 < \ldots < x_n = b\}$ of $[a,b]$ such that

$$\omega(f,\mathcal{P}) = \sum_{i=0}^{n-1} \left(\sup(f,[x_i,x_{i+1}])-\inf(f,[x_i,x_{i+1}]) \right) (x_{i+1} - x_{i}) < \epsilon.$$

The quantity

$\omega(f,[x_i,x_{i+1}]) = \left(\sup(f,[x_i,x_{i+1}])-\inf(f,[x_i,x_{i+1}] \right)$

is sometimes called the oscillation of $f$ on the (sub)interval $[x_i,x_{i+1}]$, since it measures the difference between the largest and smallest values. I claim that for any function $f: I \rightarrow \mathbb{R}$, taking the absolute value does not increase the oscillation: $\omega(|f|,I) \leq \omega(f,I)$. This is a simple argument that I leave to you: note that this argument also underlies the proof that if $f$ is continuous, so is $|f|$. The result follows from this by applying Darboux's Criterion twice.

Some comments:

1) As Alex Ravsky says in his answer, we can actually "reduce" the problem to $f$ continuous at $a$ $\implies$ $|f|$ continuous at $a$ using the (Riemann-)Lebesgue criterion that $f: [a,b] \rightarrow \mathbb{R}$ is Riemann integrable iff it is bounded and its set of discontinuities has measure zero. This is overkill.

2) The result is a special case of another useful result which is usually presented in undergraduate analysis courses: if $f: [a,b] \rightarrow [c,d]$ is Riemann integrable and $\varphi: [c,d] \rightarrow \mathbb{R}$ is continuous, then $\varphi \circ f$ is Riemann integrable. Applying this with $\varphi(x)= |x|$ we get the result. For a proof, see Theorem 8.17 of these notes. This result can be applied, for instance, to show that the product of two Riemann integrable functions is Riemann integrable.

3) The proof of the theorem referred to above is not so easy. However, it becomes much easier if $\varphi$ is not just continuous but Lipschitz, i.e., if there is a constant $C$ such that $|\varphi(x)-\varphi(y)| \leq C|x-y|$ for all $x,y \in [c,d]$. This simpler case is proved separately as Theorem 8.20 in the above notes, and the proof comes down to observing that for Lipschitz $\varphi$, $\omega(\varphi \circ f, I) \leq C \omega(f,I)$. Note that the absolute value function is Lipschitz with $C = 1$, and this is exactly what we observed above.