Why are we allowed to divide by $\psi$ when $\psi=0$? 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$?
 A: Remainder to make the argument easier to understand for those who don't have Griffith at hand. He separates $t$ and $x$ (page 20)
$$\Psi(x,t)=\psi(x)f(t) \tag{2.1}$$
then Schrödinger equation becomes
$$i\hbar\, \psi\frac{df}{dt} = -\frac{\hbar^2}{2m}\frac{d^2\psi}{dx^2}\,f+V\psi\, f$$
and then he divides both side by $\psi\, f$.
The mathematically rigorous way to do this sort of things is to postulate that $\psi(x)$ is non-zero for a least one $x$, then since $\psi$ is assumed to be continuous, it is non-zero on some open interval $]x_1, x_2[$. On that interval, we can then divide by $\psi(x)$ and solve the differential equation. Then we can make the interval as big as possible, and it may end up that $\lim_{x->x_2^-}\psi(x)=0$ then. The reasoning is still entirely rigorous in $]x_1, x_2[$. But then usually what will happen is twofold 


*

*to the right of $x_2$, we have another interval $]x_2, x_3[$ on which $\psi(x)$ is non-zero. So now we can put the two pieces together: $\psi$ is defined everywhere but at $x_2$; and

*$\lim_{x->x_2^+} \psi(x)=0=\lim_{x->x_2^-}\psi(x)$, so we can define $\psi(x_2)$ to be 0 by continuity.


Troubles appear when the last condition on limit from the left and from the right does not hold.
A: This is a standard "issue" when one solves differential equation with a separation of variable. To be rigorous, the case $\psi=0$ should be handled separately. However, you can check that $\psi''=0$ when $\psi=0$, and that $\psi''/\psi$ is well behaved there, so you are in fact allowed to divide by $\psi$ on the whole interval. 
But don't say that to a mathematician.
EDIT : Since this answer has some success, I would like to improve it by showing how one can avoid the division by $\psi$. For this, let's assume that after separation of variables (i.e. after plugging the Ansatz $\psi(x,t)=T(t) X(x))$, we obtain the following PDE
$$
a T'(t)X(x)=b\, T(t) X''(x),\quad\quad (1)
$$
where $a$ and $b$ are some non-zero constants. Now assume that there exist $x_0$ and $t_0$ such that $a T'(t_0)X(x_0)=b T(t_0) X''(x_0)\neq0$. Then there is a constant $\lambda\neq 0$ such that
$$
X''(x)=\lambda X(x),\\
T'(t)=\frac ba\lambda \, T(t).
$$ 
(The case $\lambda=0$ corresponds to the case where there is no such point $(x_0,t_0)$, which is equivalent to say that $X''(x)=0$ and $T'(t)=0$.)
Proof:
Plugging $t=t_0$ in (1) gives 
$$
X''(x)=\frac{a T'(t_0)}{b\, T(t_0)}X(x),
$$
since $b T(t_0)$ does not vanish from our hypothesis. Calling $\lambda=\frac{a T'(t_0)}{b T(t_0)}$ gives the ODE for $X(x)$. Note that we also have that $\lambda=X''(x_0)/X(x_0)$ which is also a well-defined ratio. Next, plugging $x=x_0$ in (1) gives directly the ODE for T(t).
This method is trivially generalized to other PDE that can be solved by separation of variables.
