Weakly convergent sequence whose square converges strongly

Let $\phi\in C_c(\mathbb R)$ with $\phi\ge0$. The functional $f\mapsto \int_{\mathbb R} f^2 \phi\ dx $ is convex and continuous on $L^2$, hence weakly sequentially lower semi-continuous. This proves $$ \int_{\mathbb R} f^2 \phi\ dx \le \liminf_{n\to\infty} \int_{\mathbb R} f_n^2\phi\ dx. $$ Since $\liminf_{n\to\infty} \int_{\mathbb R} f_n^2\phi \ dx=\int_{\mathbb R} g\phi \ dx$, we have $$ \int_{\mathbb R} (g-f^2) \phi \ dx\ge 0. $$ Since $\phi\ge0$ was arbitrary, $g\ge f^2$ a.e. follows.

The proof also works if $f_n^2\rightharpoonup g$ in $L^1$ only.