For a quantum particle in an one-dimensional infinite well of width $L$, the potential has the formal expression: $$ V(x) = \begin{cases} \infty, & x < 0 \\ 0, & 0 \le x \le L \\ \infty, & x > L, \end{cases} $$
and the "hard wall" boundary condition is imposed: $\psi(0) = \psi(L) = 0$.
However, I don't get, where does this boundary condition come from? It is explained in books like "the wavefunction has to be continuous". However, the domain of this problem is $[0, L]$, and there is plenty of continuous (in the domain $[0, L]$) solutions for the Schrodinger's equation which are not zero at the endpoints of the domain.
As I see it, probably, a better explanation would be: consider an infinite sequence of potentials: $$ V_n(x) = \begin{cases} n, & x < 0 \\ 0, & 0 \le x \le L \\ n, & x > L \end{cases} $$
Then, by looking at the solutions $\psi_m$ of the Schrodinger equation (now we have the domain $\mathbb{R}$), we will see that for any fixed energy $E$, the solutions with total energy less than $E$, tend to zero at the well boundaries: $\lim\limits_{n \to \infty} \psi_n(0) = 0$, $\lim\limits_{n \to \infty} \psi_n(L) = 0$.
So, how should I actually interpret this boundary condition?