A basic question about the convergence a sequence of measurable functions Let $(X,\mathcal{B},\mu)$ be probability  space i.e. $\mu(X)=1$. If $\{g_n\}_{n=1}^{\infty}$ is a sequence of measurable functions such that $\Sigma_n \int g_n^2 d\mu <\infty$ then $g_n \to 0$ $\mu$-almost everywhere.

Attempt: Suppose $g_n\nrightarrow 0$ $\mu$-almost everwhere. Then $\mu(A)>0$ where $A:=\{x\in X: \lim g_n(x)\neq 0\}$. Since $A\subseteq B$ (here I use the fact that $\lim g_n^2=\lim g_n\lim g_n $), we have $\mu(B)>0$ where $B:=\{x\in X: \lim g_n^2(x)> 0 \}$. So $0<\int_B\lim g_n^2 d\mu=lim\int_B g_n^2d\mu$ by the monotone convergence theorem. So $\Sigma_n\int_Bg_n^2d\mu=\infty$, contradiction.
Can anyone check my attempt? And I am not sure the convergence in the question whether it is convergence in measure or not. Thanks!
 A: By Tonelli theorem, $\sum\limits_n\int g_n^2\,\mathrm d\mu=\int h\,\mathrm d\mu$ where $h=\sum\limits_ng_n^2$. Assume that the series (of numbers) on the LHS converges. Then $h$ is integrable. Every integrable function is finite almost everywhere hence $h$ is finite almost everywhere. Finally, at each point $x$ such that $h(x)$ is finite, one can be sure that $g_n(x)\to0$ when $n\to\infty$ since the general term of every (numerical) converging series converges to $0$. $\quad\Box$
A: An alternate approach would be to consider
$$
a_n := \int g_n^2 \, \mathrm{d} \mu
$$
then we have that
$$
\sum_{n = 1}^\infty a_n <\infty
$$
thus we must have $a_n \to 0$. Then by non-negativity of the integrand we get that $g_n^2 \to 0$ and so $g_n \to 0$.

As for your attempt you seem to assume $g_n$ still converges to something, but I don't think this can be assumed. 
As for whether this is asking about convergence in measure or not I do not think so,  generally convergence $\mu$ almost everywhere means a function converges pointwise almost everywhere (so except on a set of measure zero).
