Normalizable wavefunctions for bound states In my quantum mechanics book I read the following sentence:

If we want the wavefunction to be normalizable, one must impose boundary conditions:
$$\lim_{x \to \pm\infty} \psi(x)=0.$$

My question is as follows:
From what I understood by reading other answers on this forum, a wavefunction in general does not have to be continuous, the only condition required is that it belongs to $L^2$ (always talking about bound states, for example a harmonic oscillator).
The only condition that $\lim_{x \to \pm\infty} \psi(x)=0$, does not make the wavefunction automatically normalizable, for example a wavefunction of the type $\psi(x)=1/x^2$, meets the previous conditions but is not normalizable and is not even of class $L^2$.
Is it possible that my book is implicitly considering only continuous wavefunctions? So that the $$\lim_{x \to \pm\infty} \psi(x)=0$$
condition automatically implies that the function is normalizable and of class $L^2$?
Otherwise, I don't understand how the limit condition alone, makes the wavefunction normalizable.
Another thing I find a lot in my book about this topic are sentences like:

the eigenfunctions of $H$ for a free particle are kept finite at infinity,

and it never talks about the behavior of the wavefunction inside the domain but always at infinity. Maybe this is also because it only considers continuous wavefunctions?
 A: The book probably means that this condition is necessary, not sufficient. So it might not be enough to make the wavefunction normalizable (as you discovered), but if the wavefunction is normalizable this condition has to be true and can be used to set boundary terms to zero in specific calculations.
In fact this condition is not even necessary. There are functions which are perfectly smooth and normalizable, but don't have this limit. One could for example imagine a positive real function that at each natural number $n$ has some peak of height one, but the width is bounded by $2^{-n}$ so the integral (of the square modulus) does not diverge because it is bounded from above by the geometric series $\sum_{n=0}^{\infty}2^{-n}$.
But such pathological examples will usually not occur for the problems one is working on in introductory quantum mechanics, so it is not unreasonable to assume that the condition for the limit as $x\to\infty$ is necessary for the wavefunction to be normalized, at least as long as you don't want to be very mathematically rigorous. If rigor is your goal you could have a look at these lectures about quantum mechanics where most of the subject is presented in a very formal an mathematical way. It will likely not answer this specific question (but I hope my answer is satisfactory) but it could provide you with a mathematically rigorous "introduction" to the subject. Don't worry, they are in english although the website is in german. The lectures might be a bit advanced for you if you are just getting started, so maybe you should first work through your book and get comfortable with the subject in a heuristic way before you revisit it in a more rigorous manner. There are of course different opinions out there and at the end of the day it is your decision how you want to proceed learning.
Hope that helped.
A: *

*When discussing bound states, it is implicitly assumed that we're considering the TISE.


*In this answer, we discuss only the 1D case
$$-\frac{\hbar^2}{2m} \psi^{\prime\prime}(x) + V(x) \psi(x) ~=~ E \psi(x) $$
for simplicity.


*One may use a mathematical bootstrap argument to prove that the solution $\psi$ belongs to some $C^p(\mathbb{R})$-class, cf. e.g. my Phys.SE answer here.


*The condition
$$ \lim_{|x|\to\infty}\psi(x)~=~0. \tag{*}$$
is not sufficient to ensure that a solution $\psi\in {\cal L}^2$, if that's what OP is asking.
Sketched counterexample: Let the energy $E=0$ and the potential be of the form $$V(x)~=~\left\{\begin{array}{lcr}\frac{\hbar^2}{2m} \frac{3}{4x^2}&{\rm for}& |x|\geq 1,\cr V_0 &{\rm for}& |x|< 1.\end{array}\right.$$ Construct a solution of the form $$\psi(x)~=~\left\{\begin{array}{lcr} \frac{1}{\sqrt{|x|}}&{\rm for}& |x|\geq 1,\cr A \cos k x &{\rm for}& |x|< 1,\end{array}\right.$$ by adjusting the constants $V_0$, $A$ & $k$ appropriately. This solution satisfies the boundary condition (*) but is not normalizable.


*For the remainder of this answer, we list a case
where the boundary condition (*) actually do imply that $\psi$ is normalizable.

*

*Case
$\exists k,K>0\forall |x|\geq K:~~ {\rm Re}\left[\frac{2m}{\hbar^2}(V(x)-E)\right]  ~\geq~ k^2.$
In this case one may show that the solution $\psi\in {\cal L}^2$ iff the boundary condition (*) is satisfied, cf. e.g. my Phys.SE answer here.



A: Just a small tangential comment to add to what others have said here.  The wave function DOES indeed need to be continuous.  Otherwise, expectation values involving derivatives of the wave function such as the momentum and the kinetic energy would be undefined at the discontinuity.  The derivative of the wave function is allowed to be discontinuous only at points where the potential energy diverges, but the wave function itself must always be continuous.
