Solving $\frac{dy}{dx} = xy^2$ This problem appears to be pretty simple to me but my book gets a different answer.
$$\frac{dy}{dx} = xy^2$$
For when y is not 0
$$\frac{dy}{y^2} = x \, dx$$
$$\int \frac{dy}{y^2} = \int x \, dx$$
$$\frac{-1}{y^1} = \frac{x^2}{2}$$ 
$$\frac{-2}{x^2} = y$$ 
Is there anything wrong with this solution? It is not what my book gets but it is similar to how they do it in the example.

Continuing from what you did, we have
$$\int \frac{dy}{y^2} = \int x\,dx$$
$$-\frac{1}{y} + C_2= \frac{x^2}{2}+C_1$$
Where $C_1$ and $C_2$ are constants of integration.  Letting $C_3=C_1-C_2$
$$-\frac{1}{y} + C_2= \frac{x^2}{2}+C_1=-\frac{1}{y}= \frac{x^2}{2}+C_3$$
Solving for $y$, we have:
$$-\frac{1}{y}= \frac{x^2}{2}+C_3= \frac{x^2+2C_3}{2} \implies -y=\frac{2}{x^2+2C_3} \\
\implies y=\frac{2}{2C_3-x^2}$$
Letting $2C_3=K$
$$y=\frac{2}{2C_3-x^2}=\frac{2}{K-x^2}$$
