# Proving a piecewise function is Riemann integrable

I am dealing with the following function: $f= \begin{cases} 0\text{ if }x<0\\ 1\text{ if }x\geq 0\\ \end{cases}$ I am trying to prove that $f$ is Riemann integrable over $[-1,1]$, and that $\int_{-1}^1f=1$. This is what I have so far:

Let $\varepsilon >0$, and let $P$ be a tagged partition of mesh $<\delta$. Let $L=\int_{-1}^1f=1$. Let $t_i$ be the tags. If $t_i<0$, then $f(t_i)=0$. If $t_i\geq 0$, then $f(t_i)=1$. Assume that $t_i<0$ up to $i=k+1$, and $t_i\geq0$ for all $i$ up to $k$. Then $S(f;P)=\sum_{i=1}^{k+1}f(t_i)(x_i-x_{i-1})+\sum_{i=k+1}^nf(t_i)(x_i-x_{i-1})=0+1(x_n-x_k)=1-x_k$. Then $|L-S(f;P)|=|x_k|$.

This is where I'm stuck now. How can I show that $|x_k|<\delta$?

• Just a few superficial comments on the writing. I think you need to fix the part where you wrote "$t_i < 0$ up to $i = k + 1$ and $t_i \geq 0$ for all $i$ up to $k$." Also, when you write your final version, you'll want to define $\delta$ in terms of $\epsilon$, and write $L = 1$ without mentioning the integral, since the point is to prove its existence. The upper limit in the first sum should probably be $k$ instead of $k + 1$ (depending on how you fix the part about the $t_i$'s). Commented Jan 26, 2016 at 4:33

You have $x_{k-1} \leq t_k < 0 \leq t_{k+1} \leq x_{k+1}$, $x_k \in (x_{k-1},x_{k+1})$, and $x_{k+1} - x_{k - 1} < 2\delta$, so $|x_k| < 2\delta$.
I would probably have defined $k$ in terms of where the $x_i$'s change sign rather than where the $t_i$'s do, but your method works too.