When Griffiths derives the time-independent Schrodinger equation he divides both sides of the Schrodinger equation by $\psi$. I take this as a tacit assumption that $\psi\neq0$ when we intend to solve the time-independent Schrodinger equation for $\psi$.
Later, when solving the infinite square well, one of the boundary conditions assumes $\psi(0)=\psi(a)=0$.
I would argue that if we assume $\psi=0$ anywhere in the domain in which we intend to solve for psi, then we cannot use a time-independent Schrodinger equation that has been derived by assuming $\psi\neq0$.
And in the case of the the infinite square well, the solutions clearly have zero values in the domain $0\leq x\leq a$: $$\psi_n(x)= \sqrt{\frac{2}{a}} \sin\left(\frac{n\pi}{a} x\right) \;.$$
I'm wondering if the derivation of the time-independent Schrodinger equation does not actually depend on dividing by $\psi$, but that Griffiths used a lazy trick to let the reader more easily see, read, or follow the derivation to the final equation.
So, why are we allowed to divide by $\psi$ when $\psi=0$?