Solution (source code)

= Solution

First suppose $1\leq p<\infty$. Choose a subsequence so that
$$
\lVert f_{n_k}-f\rVert_p^p\leq2^{-k}.
$$
By <Tonelli theorem>,
$$
\int_X\sum_{k=1}^\infty|f_{n_k}-f|^p\,d\mu
=\sum_{k=1}^\infty\lVert f_{n_k}-f\rVert_p^p
<\infty.
$$
Hence the sum inside the integral is finite almost everywhere, which forces $|f_{n_k}(x)-f(x)|\to0$ almost everywhere.

If $p=\infty$, choose representatives and remove the countable union of the null sets on which
$$
|f_n-f|>\lVert f_n-f\rVert_\infty.
$$
Outside that null set, norm convergence bounds the pointwise difference and the entire sequence converges to $f$. Thus in every case \b[an almost-everywhere convergent subsequence exists], as stated in <Almost-everywhere convergent subsequence from Lp convergence>.