Infinite square well bound states

For an infinite square well, beyond the walls ( including them ) are infinite potentials and the wavefunctions have to be zero when they hit the walls because of these boundary conditions. For such a case, how do you say whether the stationary states are bounded or not? In fact my confusion springs from the fact that when we solve the Schrodinger's equation we take

$$k = \sqrt{\frac{2mE}{\hbar^2}},$$

which automatically assumes $E \geq 0$ which I thought was the condition for scattering states. However it doesn't make sense to have scattering states for this case physically. So what is going on?

For the infinite square well all stationary states are bound states. Keep in mind that all wave functions $\psi(x)$ in position space are limited to the invervall $x \in (-L/2, L/2)$. They are bound to this region of space. Your condition for scattering states is only exact for potentials that that go to $0$ (or some $c \in \mathbb{R}$). for $x \rightarrow \infty$. The more general condition is therefore \begin{align} \text{Bound state: } E &< min \left(\lim_{x \to \, -\infty} V(x),\lim_{x \to \infty} V(x) \right)\\ \end{align}
The 1d harmonic oszillator with energies $E_n = \hbar \omega ( n + 1/2)$ fullfils this condition as well, as all states are bound states. This is further discussed here.