Prove that f is integrable on [0,2] Let 
\begin{align}
f(x)=\left\{\begin{matrix}1,\:\: 0\leq x\leq 1,\\
0,\:\:1<x\leq 2.
\end{matrix}\right.
\end{align}
Prove that $f$ is integrable on $\left[0,2\right]$, and find the value of
\begin{align}
\int_0^2 f\left(x\right)\:dx.
\end{align}
In order to show that $f$ is integrable I think I need to use the following theorem:

The bounded function $f$ is integrable on $\left[a,b\right]$ if and only if for
  every positive number $\epsilon$ there exists a partition $P$ of $\left[a,b\right]$
  such that $|U\left(f,P\right) - L\left(f,P\right)|<\epsilon$.

The problem is that I'm not sure how to actually use this theorem to show it, I dont understand how I can find the value of the integral either, any tips solution? thanks!
 A: This function is integrable by definition because
\begin{align}
\int_0^2 f\left(x\right)\:dx=\int_0^1\:dx+\int_{1+}^2 0\:dx=1.
\end{align}
A: In your case there isn't much to be done because $$\int_{0}^{2} f = \int_{0}^{1}f + \underbrace{\int_{1}^{1+\epsilon}f}_{= 0} + \underbrace{\int_{1+\epsilon}^{2}}_{= 0 }f = 1$$
notice that $$\underline{\int}_{1}^{1+\epsilon}f = \overline{\int}_{1}^{1+\epsilon}f = 0$$
And it's possible to show that every step-function $f: [a,b] \to \mathbb R$ is integrable and its integral is given by 
$$\int_{a}^{b} f(x) dx = \sum_{i=1}^{n} c_i (t_i- t_{i-1})$$
where $f$ is constant at $c_i$ on the intervals $(t_{i-1}, t_i)$. 
A: You probably have a theorem giving you
$$ \int_0^2 f(x)\,dx = \int_0^1 f(x)\,dx + \int_1^2 f(x)\,dx $$
Here, the first term on the right-hand side is $1$ because the integrand is constant on $[0,1]$, so every Riemann sum is $1$.
For the second term, the only term is a Riemann sum that can be different from $0$ is the first, if we select $1$ as the representative point in the first interval. But in that case the term in question is the length of the first interval, so it can be made as small as we like by selecting a sufficiently fine division.
So the second term is 0 and the entire integral must be 1.
