I am trying to solve the differential equation $\frac{dy}{dx}=(x+y)^{2}$, $y(0)=0$. What I have tried so far is the substitution $y(x)=-x+z(x)$ and $z(0)=0$, this simplifies the differential equation to:
$$\frac{dz}{dx}=1+z^{2}$$
Which I can solve by separation of variables to give $z(x)=\tan{x}$, this gives $y(x)=-x+\tan{x}$. This is a solution to the differential equation in the title if I test it with the given differential equation, but it is not continuous in $\pi/2+k\pi,k\in\mathbb{Z}$. So I believe I am doing something wrong as I expect the solution to be continuous. Is my solution right? Or should I be approaching this differently?