Is this a good argument on what makes the Lebesgue integral more general than the Riemann integral? Ever since I learned about the Lebesgue integral I have tried to understand what exactly makes it more general than the Riemann integral. By this I mean what part of its definition makes it more general. Below I will only talk about positive functions defined on some interval $[a, b]\subset \mathbb{R}$.
Here is what I've come up with: when defining the Riemann integral, we use step functions, which are linear combinations of characteristic functions of intervals; when defining the Lebesgue integral, we use measurable simple functions, which are linear combinations of characteristic functions of measurable sets. I think that this is the point of the theory that makes the Lebesgue integral more general. In particular, I think that this is what makes the function $$f(x)=\begin{cases} 1 & x\in [0, 1]\cap \mathbb{Q} \\ 0 & x\in [0, 1]\cap (\mathbb{R}\setminus \mathbb{Q}) \end{cases}$$ Lebesgue integrable and not Riemann integrable.
Furthermore, I think that the reason why for the Riemann integral we use characteristic functions of intervals is because these are the only Jordan measurable subsets of $\mathbb{R}$ that are "interesting" (I can't really think of a Jordan measurable subset of $\mathbb{R}$ that is not an interval except some weird looking examples that end up having Jordan measure zero) and for the Riemann integral we wish to have a good connection with the Jordan measure. So, I think that we may also say that the reason why the Lebesgue integral is more general than the Riemann integrable is that the Lebesgue measure is more general than the Jordan measure.
Are the above arguments correct? I have really thought about this a lot and I really want to make sure that I know what part of the definition of the Lebesgue integral grants it its generality.
 A: $\newcommand{\d}{\mathrm{d}}$Edit: that was not what they meant - my bad - but I’ll leave the discussion of improper integrals anyway.
OP:
To clarify on the comment by user950314, they refer to improper Riemann integrals. Lebesgue integration doesn’t handle improper integrals very well, but the improperly Riemann integrals functions themselves can still be Lebesgue integrated on any fixed measurable set. There’s just the unfortunate terminology clash where Lebesgue “integrable” means the integral of its absolute value is finite, as opposed to just meaning “can be integrated”.
Lebesgue’s theory is more general in many ways. For starters, the concept of $\d\mu$ can be anything you wish provided it satisfies some fairly minimal axioms of measure. This immediately explains why measure theory is central to advanced probability theory, as I can simply define any probability measure appropriate for the task and go from there, and most of the theorems of measure theory will follow with me, even though I am using an arbitary and different measure. Through this, I can get beautiful results like monotone convergence, or Radon-Nikodym, to very abstract spaces - can Riemann do this? The notion of interval immediately breaks down in spaces other than $\Bbb C^n$. Consider probability distributions that have both continuous and discrete elements (atoms); a headache for Riemann’s integral.
Aside from that level of flexibility, the Lebesgue integral is "theoretically nice". If I let $\d x$ indicate a Riemann integral, and $\d\mu$ indicate a Lebesgue integral, I have that:
$$\begin{align}\lim_{n\to\infty}\int f(x,n)\,\d x&=\int\lim_{n\to\infty}f(x,n)\,\d x\quad\text{If $f(x,n)$ converges uniformly}\\\lim_{n\to\infty}\int f(x,n)\,\d\mu(x)&=\int\lim_{n\to\infty}f(x,n)\,\d\mu(x)\quad\text{If $f(x,n)$ converges monotonically/dominated}\end{align}$$
Notice that I can apply the second conditions very often, but can apply Riemann's criterion only relatively rarely, and with a greater difficulty of proof - uniform convergence is a strong condition and difficult to achieve when dealing with general cases. Thus working with Lebesgue's integral (which can be made into a discrete sum with the counting measure, so many things transfer to sums and series) is significantly easier and I can justify integral-limit exchange very often. Likewise for Fubini-Torelli's theorem, a very powerful tool.
There's more to say, but I'll finish with this: you're right in thinking that using measurable sets in general as opposed to merely intervals is powerful. Moreover, it means I can integrate a much larger class of functions. Riemann can only integrate functions with countably many discontinuities; Lebesgue laughs, and integrates measurable functions that are discontinuous in uncountably many places.
Hopefully this helps. I’m not an expert, so I’m sure there are many more reasons you could add here.
A: Good question.  One reason why one might ponder about this is to recall Lebesgue's original defintion, developing measure theory first, then defining the integral for all bounded measurable functions, then extending to unbounded "summable"
functions.   What has this to do with Riemann's definition?   Why on earth is every Riemann integrable function a bounded measurable function? And (in the other direction) why on earth is there   a bounded measurable function that is not Riemann integrable?   If you don't ask such questions you weren't paying attention.
Lebegue doesn't help.  His definition is so remote from Riemann's that it takes a long time in his thesis to prove the connection.  That remoteness also alienated many mathematicians of his time.
The short historical answer (Maybe not satisfying for you).

*

*Volterra in the 1880s gave an example of a function $F:[0,1]\to\mathbb R$
with $f=F'$ bounded but not Riemann integrable.


*Lebesgue, motivated by that example, designed an integral guaranteed to include all Riemann integrable functions but also integrate all bounded derivatives.  [Indeed he explicitly claimed that as goal.]

Preliminaries:  First let's clarify what we are talking about.  Take an interval $[a,b]$ and write the following:
${\cal C}[a,b]$ --- all continuous functions on $[a,b]$
${\cal D}[a,b]$ --- all derivatives on $[a,b]$, i.e., $F'=f$ for all points for some function $F$.
$b{\cal D}[a,b]$ --- all bounded derivatives on $[a,b]$
${\cal R}[a,b]$ --- all Riemann integrable functions on $[a,b]$
${\cal IR}[a,b]$ --- all improperly Riemann integrable functions on $[a,b]$
${\cal L}[a,b]$ --- all Lebesgue integrable functions on $[a,b]$
${\cal IL}[a,b]$ --- all improperly Lebesgue integrable functions on $[a,b]$
If you understand your integration theory (and you should before considering such questions as this) you should know these facts intimately:

*

*${\cal C}[a,b] \subset b{\cal D}[a,b] \subset b{\cal L}[a,b] 
\subset  {\cal L}[a,b] \subset {\cal IL}[a,b]$  and  all inclusions proper.


*While $ b{\cal D}[a,b] \subset b{\cal L}[a,b]$  it is the case that
$b{\cal D}[a,b] \not\subset  {\cal R}[a,b] $.   This is the original motivation Lebesgue gave for his integral.


*$  {\cal IR}[a,b] \not \subset {\cal L}[a,b]$
and $  {\cal L}[a,b] \not \subset {\cal IR}[a,b]$  although they are compatible, i.e., if a function is integrable in both senses the integrals agree.


*But $  {\cal D}[a,b] \not \subset  {\cal L}[a,b]$  and  $  {\cal D}[a,b] \not \subset  {\cal IL}[a,b]$  which is the reason why integration theory did not stop with Lebesgue. [To elaborate a bit: Lebesgue's integral handles all bounded derivatives but only some unbounded derivatives.  He did not like this fact!]

Q.  Back to your question:  What part of the definition
of ${\cal L}[a,b]$ explains why $b{\cal L}[a,b]\supset {\cal R}[a,b]$ and
$b{\cal L}[a,b] \not= {\cal R}[a,b]$?
A1.  Well this depends on which of the very many definitions of the Lebesgue integral you are using.   If you use the measure-theoretic definition for
${\cal L}[a,b]$ and the orginal definition for ${\cal R}[a,b]$ this is a puzzle.  But you are correct:  if you use instead the Peano-Jordan measure definition of ${\cal R}[a,b]$ (as you suggested) then the explanation is quite clear.  Just check that all PJ-measurable sets are measurable and give one simple example of a measurable set that is not  PJ-measurable.  Your thinking here is fine!
A2.  But you might have seen a different definition for ${\cal L}[a,b]$ as
the completion of the space ${\cal C}[a,b]$ using the norm
$\|f\| = \int_a^b |f(x)|\,dx$.   In that case your explanation  will need to show that this completion contains ${\cal R}[a,b]$ but that there are bounded functions in that completion not contained in ${\cal R}[a,b]$.
A3.  Perhaps you are a fan of defining ${\cal L}[a,b]$ using Riemann sums monitored by a gauge (as developed in the 1960s).  Then it is immediate and trivial that ${\cal L}[a,b]\supset{\cal R}[a,b]$  and, again, one bounded counterexample will suffice.
A4.  I doubt you want any more definitions for ${\cal L}[a,b]$.  So bye.
