not Lebesgue integrable function

An example of a function that is not Lebesgue integrable but is Riemann integrable is

This is because in the Lebesgue integral,

where is the Lebesgue measure.

The Riemann integral doesn’t have this problem since the function alternates so some of the negative portion “cancels out” some of the positive ones from earlier partition intervals. Thus,