How many functions are possible for the given differential equation? There was this question asked in a competitive examination , the solution of which is very confusing to me.

The number of differentiable functions
$y:(-\infty, \infty) \rightarrow [0, \infty)$ satisfying $ y' = 2 \sqrt y $ , $y(0)=0$ is

The answer says there exists infinitely many solutions but I could get only one by solving the differential equation.
Can someone help me figuring this out ?
 A: My answer is treating $y'=2\sqrt{|y|}$ instead of $y'=2\sqrt{y}$. In my experience the problem I consider is the more common way this exercise is stated. If you actually meant $y'=2\sqrt{y}$ and are restricting attention to nonnegative solutions, then you can recover what you want by setting $a=-\infty$ at the end of the discussion below.
The "obvious" solution to this IVP is the one you get by separation of variables. This is just $y=x |x|$, i.e. $y=\begin{cases} x^2 & x \geq 0 \\ -x^2 & x<0 \end{cases}$.
But separation of variables more or less assumes you don't divide by zero, certainly that you don't divide by zero on an interval. The other solutions to this IVP do have the RHS equal to zero on an interval.
Specifically, what happens is that these solutions can start going down from zero as you move to the left anywhere, and can start moving up from zero as you move to the right anywhere as well. Once you move away from zero even a little bit, separation of variables is valid again, and so you can solve the problem off the interval on which $y$ is zero.
Mathematically the result of the above is
$$y(x)=\begin{cases} -(x-a)^2 & x< a \\ 0 & a \leq x \leq b \\ (x-b)^2 & x>b \end{cases}$$
where $-\infty \leq a \leq b \leq \infty$. The solutions with $y(0)=0$ are those with $0 \in [a,b]$.
This is a rather standard exercise in real analysis, posed to illustrate what can happen when the hypotheses of the Picard-Lindelof theorem are violated.
