Is it legitimate to divide both sides of an ODE by a dependent variable that can equal zero? I have the following problem:
\begin{cases}
y(x) =\left(\dfrac14\right)\left(\dfrac{\mathrm dy}{\mathrm dx}\right)^2 \\
y(0)=0 
\end{cases}
Which can be written as:
$$ \pm 2\sqrt{y} = \frac{dy}{dx} $$
I then take the positive case and treat it as an autonomous, seperable ODE.  I get $f(x)=x^2$ as my solution.
In order to solve this problem, I have to divide each side of the equation by $\frac{1}{\sqrt{y}}$.  But since the solution to this IVP is $y(x)=x^2$, zero is in the image of $f(x)$.  So at a particular point $1/\sqrt{y}$ is not defined.  But the solution is defined at $y =0$.
In fact, $y(x)= 0$ for all x is another solution.  But aside from this solution the non-trivial solution is defined at zero also.
So is it wrong to divide across by $1/\sqrt{y}$? And if so how else do I approach this question?
 A: I will use the shorthand $y'$ for $\frac{\mathrm{d}y}{\mathrm{d}x}$. What you need to do is carefully sort out exactly what you have shown.
(note: I am assuming $y'$ is continuous; I'm not sure if a solution with discontinuous $y'$ is possible)
E.g. for the equation $2 \sqrt{y} = y'$, your solution method leads to the conclusion

On any interval where $y' = 2 \sqrt{y}$ and $y > 0$, there is a constant $c$ such that $y = (x + c)^2$

or going back to the original equation,

On any interval where $y > 0$ and $y' > 0$, there is a constant $c$ such that $y = (x + c)^2$

Together with the negative square root, and the fact that $y'$ can't change signs without passing through a point where $y=0$, you can ultimately conclude

On any interval where $y > 0$, there is a constant $c$ such that $y = (x + c)^2$

Since $y$ is continuous and differentiable, we can see that if $y$ is given by such a formula near some point, it can be extended by the same formula until we reach a boundary where $y$ becomes zero, and the results above no longer constrain $y$.
So if we know $y$ is given by $(x+c)^2$ near some point $x=a$, then $y$ is given by the same formula on either the interval $(-c, \infty)$ or $(-\infty, -c)$, depending on whether $a > -c$ or $a < -c$.
So, we can build a solution $y$ out of the following pieces:


*

*On an interval of the form $(-\infty, c]$, we can set $y = (x-c)^2$

*On an interval of the form $[c, \infty)$, we can set $y = (x-c)^2$

*On any closed interval, we can set $y = 0$


We have a final constraint: that $y$ must be continuous and differentiable! In general this puts constraints on how we can assemble partial solutions into a total solution. However, you can check at all of the boundary points you have $y=y'=0$, so it turns out these partial solutions can be assembled in any way we please.
So, the total solution space to the equation $4y = y'^2$ is that $y$ has one of the following forms:
$$ y = \begin{cases}
(x-a)^2 & x \leq a
\\ 0 & a \leq x \leq b
\\ (x-b)^2 & b \leq x
\end{cases} $$
$$ y = \begin{cases}
0 & x \leq b
\\ (x-b)^2 & b \leq x
\end{cases} $$
$$ y = \begin{cases}
(x-a)^2 & x \leq a
\\ 0 & a \leq x
\end{cases} $$
$$ y = 0 $$
where $a,b$ are constants with $a \leq b$. (they can be equal)
All of these forms are consistent with having $y=0$ when $x=0$, assuming you choose $a \leq 0$ and $0 \leq b$.
Here's a sample solution from the first form with $a=-2$ and $b=3$:
(source: wolfram alpha)
A: Consider
$$y'(x)=2\sqrt{y(x)}$$
that has the trivial solution $y(x)=0$.
Assume there is a range of $x$ such that $y(x)>0$. In this unknown range, by solving the separable equation (no division by zero) we obtain
$$\sqrt{y(x)}=x-x_+.$$ for some $x_+$. As a square root is positive, must have
$$x\ge x_+$$ and this gives the partial solution
$$(x_0,\infty)\to y(x)=(x-x_+)^2.$$
As the function $y$ is non-decreasing, for the rest of the domain we can follow the other branch
$$(-\infty,x_+]\to y(x)=0.$$
Then for $x_+\ge0$, a solution that fulfills the initial condition $y(0)=0$ is
$$y(x)=\begin{cases}(-\infty,x_+]&\to 0,\\(x_+,\infty)&\to(x-x_+)^2.\end{cases}$$

Extending the analysis to
$$y'^2(x)=4y(x)^*,$$
with $x_-\le0\le x_+$,
$$y(x)=\begin{cases}(-\infty,x_-)&\to (x-x_-)^2,\\ [x_-,x_+]&\to 0,\\(x_+,\infty)&\to(x-x_+)^2.\end{cases}$$
Note that $x_-$ or $x_+$ can be rejected at infinity.
$^*$This requires that $y$ be twice differentiable otherwise the case is pathological.
