Solution (source code)

= Solution

For $1<p<\infty$, apply <Fatou lemma> to the nonnegative <sequence> $|f_n|^p$, which converges pointwise to $|f|^p$:
$$
\int_{\mathbb R}|f|^p\,d\lambda
\le\liminf_n\int_{\mathbb R}|f_n|^p\,d\lambda\le M^p.
$$
For $p=\infty$, each inequality $\|f_n\|_\infty\le M$ fails pointwise only on a null <set>. Outside the union of these countably many null <sets>, $|f_n(x)|\le M$ for every $n$, so the pointwise limit also satisfies $|f(x)|\le M$. Therefore in both cases
$$
\boxed{f\in L^p(\mathbb R),\qquad\|f\|_p\le M}.
$$