How to prove that function $f$ is Riemann integrable Let $f: [0,2] \rightarrow \mathbb{R}$ a bounded function with
$$ f(x) = \begin{cases}
x \qquad \qquad 0 \leq x \leq 1 \\
x-1 \qquad \quad 1 < x \leq 2
\end{cases} $$
Prove that $f$ is Riemann integrable and calculate $\int_0^2 f(x)dx$. 
Can I prove this by saying that since $f$ is monotonically increasing on the interval $[0,1]$ and on the interval $(1,2]$, it is Riemann integrable on the interval $[0,2]$. And how do I calculate the integral using an upper and lower integral and upper and lower sums?
 A: You could use the fact that if $f$ is integrable on $[a,b]$ and $[b,c]$ then $f$ is integrable on $[a,c]$ and satisfies
  $$ \int_{a}^{c} f = \int_{a}^{b} f + \int_{b}^{c} f $$
Now $\int_{1}^{2} x - 1 \, dx = \int_{0}^{1} u \, du$ and therefore it suffices to show that $\int_{0}^{1} x \, dx$ is integrable.
The lower sums are
  $$ L = \sum_{i=1}^{n} f(t_{i-1})(t_{i} - t_{i-1})  $$
and the upper sums are
  $$ U = \sum_{i=1}^{n} f(t_{i})(t_{i} - t_{i-1}) $$
If we use the uniform partition where $t_{i} = a + \frac{b-a}{n}i = \frac{i}{n}$ then these become
 \begin{align*}
  L
  & = \sum_{i=1}^{n} \frac{i-1}{n} \frac{1}{n} \\
  & = \frac{1}{n^{2}} \sum_{i=1}^{n} (i - 1) \\
  & = \frac{(n-1)(n)}{2n^{2}} \\
  & = \frac{n^{2} - n}{2n^{2}} \\
  & = \frac{1 - \frac{1}{n}}{2} \\
  & \rightarrow \frac{1}{2}, \, \text{ as } n \rightarrow \infty
  \end{align*}
You should be able to show that $U = \frac{n^{2}+n}{2n^{2}} \rightarrow \frac{1}{2}$. Since the upper sum and lower sum both converge to the same value, the integral is defined.
A: Let $\mathcal{P}=\{0=x_0<x_1<...,x_n=2\}$ be any partition. Let $j_0$ be such that $1\in[x_{j_0},x_{j_0+1})$. Then
\begin{align}
U(f,\mathcal{P})&=\sum_{k=0}^{j_0-1}x_{k+1}(x_{k+1}-x_k)+\sum_{k=j_0+1}^{n}(x_{k+1}-1)(x_{k+1}-x_k) \,+f(1)(x_{j_0+1}-x_{j_0}) \\
L(f,\mathcal{P})&=\sum_{k=0}^{j_0-1}x_{k}(x_{k+1}-x_k)+\sum_{k=j_0+1}^{n}(x_{k}-1)(x_{k+1}-x_k) \,+0\,(x_{j_0+1}-x_{j_0}) 
\end{align}
Subtracting, we find
\begin{align}
U(f,\mathcal{P})-L(f,\mathcal{P})&=\sum_{k=0}^{j_0-1}(x_{k+1}-x_k)^2+\sum_{k=j_0+1}^{n}(x_{k+1}-x_k)^2 \,+f(1)\,(x_{j_0+1}-x_{j_0}). 
\end{align}
Given $\epsilon>0$, how can you make this small?
A: The given function is not continuous at x=1. But that doesn’t matter since f can afford the luxury of discontinuity on a set of measure zero. So you must simply integrate neglecting the discontinuity to get the solution. 
