Question: Let $S$ be the sawtooth function defined by
$$ S(u) = \left\{ \begin{array}{ll} u & \quad 0 \leq u \leq 1 \\ u - 1 & \quad 1 < u \leq 2 \end{array} \right. $$
Prove that $S$ is Riemann integrable.
My Attempt
If $S : [0, 2]\rightarrow\mathbb{R}$, we want to show that $S$ is Riemann integrable.
We first need to show that $S_1 : [0, 1] \rightarrow\mathbb{R}$ where $S(u) = u$ is Riemann integrable. Suppose we let $P_n$ be a partition of the interval $[0, 1]$. Then we will have
$$P_n = \left\{[0, \frac{1}{n}],[\frac{1}{n}, \frac{2}{n}],...,[\frac{n-1}{n}, 1]\right\}$$
Then it follows that \begin{align*} u_i - u_{i - 1} &= \frac{1}{n} \\ m_i &= \frac{i - 1}{n} \\ M_i &= \frac{i}{n} \end{align*}
Then from here, we can say that for a given $\epsilon > 0$ \begin{align*} U(S_1, P) - L(S_1, P) &= \sum_{i = 1}^n M_i(u_i - u_{i - 1}) - \sum_{i = 1}^n m_i(u_i - u_{i - 1}) < \epsilon \\ \end{align*}
I am not exactly sure if I am on the right track, and I am not exactly sure how I should proceed from here.
Here is an easy way to do this.
Just observe that for any $x,y\in [0,2]$ for any $\epsilon >0$ there is a $\delta >0$ such that $$ |S(x) - S(y)| < \epsilon/2 $$ whenever $|x - y| < \delta $
Consider the partition $P_n$ as you considered in question such that $1/n <\delta$. Since $S$ is continous in each interval it attains maximum and minimum there, so $M_i = S(a_i)$ and $m_i = S(b_i)$. Now just observe that $|a_i - b_i| < \frac{1}{n} < \delta$ which implies that $M_i - m_i < \epsilon /2$.
So $U(S,P_n) - L(S,P_n) = \sum_{i=1}^{n} (M_i - m_i)(u_i - u_{i-1}) < \frac{\epsilon}{2} (u_n - u_0) = \epsilon$