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?
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.