Answer
$$y=-\sqrt{\ln(x^2+e^4)}.$$
Work Step by Step
By separation of variables, we have
$$ye^{y^2}dy=xdx$$
then by integration, we get
$$\frac{1}{2}e^{y^2}=\frac{1}{2}x^2+c\Longrightarrow y^2=\ln(x^2+A).$$
Now, since $y(0)=-2$, then $4=\ln(0+A)\Longrightarrow A= e^{4}$.
So the general solution is given by
$$y^2=\ln(x^2+e^4).$$
We take the square root to get:
$$y=-\sqrt{\ln(x^2+e^4)}.$$
Note that we use the negative value because we know that $y(0)$ is negative.