Let $\{f_i\}$ be a sequence of pointwise discontinuous functions whose limit is Dirichlet's function. I read that
$\lim_{n\to\infty}\int f_n(x)dx \not= \int \lim_{n\to\infty} f_n(x)dx$
as the right hand side attempts to integrate Dirichlet's function, which is not (Riemann) integrable. I get that part.
I don't really understand why the left hand makes sense though. I see that for any finite $i$, $f_i$ it is discontinuous on a non-dense set, so it's integrable, but when $i$ goes to infinity it seems to me like this integral shouldn't exist.
I guess one confusion is it seems like $\frac{d}{dx}(\lim_{n\to\infty}\int f_n(x)dx)$ should equal $\lim_{n\to\infty}f_n(x)$ which I suppose can't be true, but it doesn't seem obvious why.