Riemann integrable functions: $\left|\int_a^bf(x)\,\mathrm dx\right|\le\int_a^b|f(x)|\,\mathrm dx$ Suppose that $f\colon [a,b]\rightarrow \mathbb R$ is bounded and has finitely many discontinuities. Show that as a function of $x$ the expression $|f(x)|$ is bounded with finitely many discontinuities and is thus Riemann integrable. Then show that:
$$\left|\int_a^bf(x)\,\mathrm dx\right|\le\int_a^b|f(x)|\,\mathrm dx.$$
I have no idea where to even begin this problem.
 A: hint: $|f(x)| = \max(f(x), 0) - \min(f(x), 0)$
hint: $f(x) = \max(f(x), 0) + \min(f(x), 0)$
hint: if f and g are Riemann integrable functions, then so is $f+g$, $\int (f+g) = \int f + \int g$
A: First, note$^{\dagger}$ that $$||f(x)|-|f(a)||\leq |f(x)-f(a)|$$
so that $|f|$ as at most the same number of discontinuities $f$ has. Reason: if $f$ is continuous at $x=a$, the above inequality implies $|f|$ is continuous too. 
$\dagger$: This is a "reversed" version of the triangle inequality. The usual one is $$|x'+y|\leq |x'|+|y|$$
Now, put $x'=x-y$. Then $|x|\leq |x-y|+|y|$ and thus $|y|\leq |x-y|+|x|$. This gives $-|x-y|\leq |x|-|y|\leq |x-y|$ which is $||x|-|y||\leq |x-y|$, the "reverse" triangle inequality.

Recall that a (tagged) Riemann sum for $f$ in $[a,b]$ looks like $$S(f,P)=\sum_{i=1}^n f(t_i)(x_i-x_{i-1})$$
A tagged partition for $|f|$ will have the form  $$S(|f|,P)=\sum_{k=1}^n |f(t_i)|(x_i-x_{i-1})$$
Note that $$\begin{align}|S(f,P)|&=\left|\sum_{i=1}^nf(t_i)(x_i-x_{i-1})\right|\\ &\leq \sum_{i=1}^n |f(x_i)||x_i-x_{i-1}|\\&=\sum_{i=1}^n |f(x_i)|(x_i-x_{i-1})=S(|f|,P)\end{align}$$
For we always assume $x_i>x_{i-1}$. Since we assume $f$ is bounded, this means that there is a constant $M$ such that $$-M\leq f(x)\leq M$$
But we can write this as $$|f(x)|\leq M$$
Since the absolute value is always positive, we get $$0\leq |f(x)|\leq M$$
A: As $f$ is bounded, $\exists M > 0$ such that $-M \leq f(x) \leq M$ for all $x \in [a,b]$. This implies that $|f(x)| \leq M$ for all $x \in [a,b]$. Thus, $|f|$ is bounded. Again as absolute values is a continuous function, $|f|$ is continuous wherever $f$ is continuous. Hence $|f|$ has at most finitely many discontinuities. Now, we know that a function with finitely many discontinuities is Riemann integrable.
For the inequality, choose $c = \pm 1$ such that $c\int f > 0$. Then
$$ \left|\int f\right| = c\int f = \int cf \leq \int |f|$$
since $cf \leq |f|$.
