I am teaching myself quantum mechanics and have just read the particle in a box explanation, which is the first derivation of a theoretical reason why only discrete energy levels are possible within certain bound scenarios. In Shankar, the argument uses a requirement that the wave function, expressed in the spatial basis, must be continuous and have a continuous first spatial derivative. This requirement is the key that leads to the wave function only being able to take the form of standing waves within the length of the (one-dimensional) box, and hence only allowing energy levels corresponding to the harmonics in that series. Where does the continuity requirement come from though? It was not in the postulates of Quantum Mechanics as Shankar stated them. Further, it does not even seem to be an intrinsically necessary requirement. While one might expect the wave function to be continuous over space, it seems entirely reasonable to me that it should be discontinuous at a barrier, especially if that barrier is formed by an infinite leap in potential.