The nature of "hard wall" boundary condition for Schrodinger's equation 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?
 A: The domain of the problem is the entire real line, not $[0,L]$. Otherwise the potential would not be specified for $x>L, x<0$. Thus, calculate the total energy of any wavefunction that does not vanish at $x = 0,L$, you will find it to be infinite. Therefore for all eigenstates that do not have infinite energy, i.e. the entire spectrum, the wavefunction vanishes at the boundaries.
A: Consider the situation where $\psi$ is non-zero at the boundary, this would imply that the modulus square of the wave function is non-zero. Thus, there is a chance of observing the particle at the boundary. If this was true, then by the relation that $$F = \nabla V$$ this would imply infinite force, and thus infinite acceleration. Such situations are nonsense in physics, thus we must impart that $\psi$ is zero at the boundary.  
A: This is a very interesting question. I'm currently trying to review the answer more rigorously myself. Notice that this boundary condition is only true for the raw Schrödinger equation
$$ H = \frac{p^2}{2m} + V_{\text{hard wall}}(x) \rightarrow \psi(\pm L) = 0,$$
where $x=\pm L$ are the edges defined by the hard wall. However, for effective models, the Hamiltonian might be linear in the momentum $p$ (Dirac-like). In this case the wave-function (envelope function/spinor $\phi(x)$, actually) is discontinuous
$$ H_{eff} = v_F \sigma_p \cdot p \rightarrow [\sigma_p \pm i \sigma_c]\phi(\pm L) = 0.$$
Check these papers: Berry, Mondragon, Proc. Royal Soc. Lond., 412, 53 (1987) and Resende et al, Phys. Rev. B 96, 161113 (2017).
Nonetheless, on $H_{eff}$ the envelope $\phi(x)$ is the coefficients from an expansion of the original wave-function $\psi(x)$ on some basis. And it is implied on the boundary condition for $\phi(x)$ that its underlying wave-function $\psi(\pm L) = 0$ at the hard-walls. See also Brey, Fertig, Phys. Rev. B. 73, 235411 (2006), where their boundary condition for graphene is obtained by imposing that the total wave-function $\psi(\pm L) = 0$ at the borders, which leads to envelope spinors $\phi(x)$ obeying a non-trivial boundary condition, which is (implicitly) equivalent to the one for $H_{eff}$ above.
This is an interesting and delicate issue that I'll try to express more rigorously in my next paper. Currently we are trimming the edges on the discussion to make it clear. I'll try to remember to edit this post and add the reference here once it is finished.
A: A little more addition to the discussion:-
No chance of tunneling through hard wall boundaries.Wave function and its derivative both must maintain continuity at the boundary. This dictates the fact that the boundary is hard walled. 
