As is known almost everywhere continuous function is measurable. Hence it's in the $L_2$. Conversely, if we suppose that $f(x) \in L_2$, we may consider that $f(x)^2$ is measurable. So it's sufficient to us to find
$f(x)$ such that it's square would be measurable but function itself would not.
let $C$ - some immeasurable set such that $C \subset \mathbb{R}$.
we define $f(x):$
$$f(x) =
\left\{\begin{matrix}1, \: x \in C\\-1, \: x \notin C\end{matrix}\right.$$
Obviously, $f(x)$ - immeasurable function, but $f^2(x) = 1$ - easy to see, it's measureable.