This is part of my homework assignment and I have been stuck on it for a few days.
Let f be the function on [0,1] given by f(x)= { 1 if x does not = 1/2 and 2 if x=1/2
Prove f is Riemann integrable and compute ∫f(x)dx from 0 to 1
[Hint from text: For each ε > 0, find a partition P so that Up(f) - Lp(f) ≤ 3]
My professor also made a suggestion to do a Riemann sum from the midpoint.
Following the hint let us partition $[0,1 ] $ into $2^{n+1}$ intervals of length $2^n$, by splitting the interval at the midpoint, then continuing in that fashion.
So our partition is $P_n=\{[x_i,x_{i+1}]=[\frac{(i-1)}{2^{n}},\frac{i}{2^n}],i=1,...,2^n\}$ Now our lower sum is $L(P,f)=\sum_{k=1}^{2^n}\frac{1}{2^n}\inf_{x\in[x_k,x_k+1]}f(x)=\sum_{k=1}^{2^n}\frac{1}{2^n}=1$, and our upper sum is:
$U(P,f)\sum_{k=1}^{2^n}\frac{1}{2^n}\sup_{x\in[x_k,x_k+1]}f(x)=\sum_{k=1}^{2^n-2}\frac{1}{2^n}+\frac{4}{2^n}=1-\frac{1}{2^{n-1}}+\frac{1}{2^{n-2}}$
Now: $U(P,f)-L(P,f)= 1-\frac{1}{2^{n-1}}+\frac{1}{2^{n-2}}-1=\frac {1}{2^{n-2}}-\frac {1}{2^{n-1}}=\frac {1}{2^{n-1}}\le \epsilon $, for $n$ sufficiently large. Hope that helps.