Schutz's book (p.10) mentions in passing a theorem in functional analysis that says that any square-integrable function $g$ may be approximated by an analytic function $f$ in such a way that the integral of $(g-f)^{2}$ over the domain of concern may be made as small as one wishes. And that this justifies why in physics we don't hesitate much to assume that a function is analytic if it helps establish a result.
My question: what is this theorem exactly (does it have a name)? And does the inverse hold: will an analytic function always be square integrable, say over an open set in $R^{n}$ ? Any physical examples will also be appreciated.
For example: if I have a wave function that is not square integrable over some region in $R$ (or over all of $R$) can I represent it as a Taylor series? Or as Fourier or power series in general?