This question is from Spivak's Calculus Chapter $ 13$ Integrals Problem $33$ (it deals with upper and lower sums which is what the $L$ and $U$ denote):
I can't seem to do part (b). I tried just defining the $U(f,P)$ but can't get anything that will lead to the answer which is $1/2$. I know that we effectively try to find the integral but I don't how you'd do that with this kind of piecewise function.