If you are looking for a good reason to prefer the Lebesgue integral over the Riemann integral and remember something like “Lebesgue goes better with limits” but could not memorize a specific example, then you should have a look on this stunning sequence of functions (which I found in Brenner and Scotts “Mathematical Theory of Finite Element Methods”):

Let {(r_n)_{n\in\mathbb{N}}} be a dense subset of {[0,1]} (e.g. an enumeration of the rational numbers) and build the functions

\displaystyle f_n(x) = \sum_{k=0}^n 2^{-k}\log(|x-r_k|).

The functions {f_n} accumulate singularities at the places {r_k} as illustrated vaguely in this picture:

However, each function {f_n} is (improper) Riemann-integrable (note that {\log(|x|)} is Riemann-integrable over any compact interval) Moreover, even the integrals {|\int_0^1 f_n(x){\mathrm d}{x}|} stay bounded for {n\rightarrow\infty}. Of course, the functions are also Lebesgue measurable.

To see why this sequence of functions is problematic for Riemann integration, consider the potential limit function

\displaystyle f(x) = \sum_{k=0}^\infty 2^{-k}\log(|x-r_k|)

which has “the value {-\infty} on a dense subset”. Hence, the Riemann integral can not be finite.

However, it is clear that {\|f - f_n\|_p\rightarrow 0} for {1\leq p<\infty} (due to exponentially decaying weights) and since the {L^p}-spaces are Banach spaces, {f\in L^p}.