Find all the roots of the equation $z^2 + |z| = 0$ . Find all the roots of the equation $z^2 + |z| = 0$ .
My solution goes like this:

Let $z=a+ib$, and $z^4=|z|^2\implies a^4+4a^3ib+6a^2(ib)^2+4a(ib)^3+(ib)^4=a^4+4a^3ib-6a^2b^2-4ab^3i=a^2+b^2\implies a^4+b^4+4a^3ib-6a^2b^2-4aib^3+b^4=a^2+b^2\implies a^4+b^4+4i(a^3-b^3)=a^2+b^2+6a^2b^2\implies a^4+b^4-2a^2b^2+4i(a^3-b^3)=a^2+b^2+4a^2b^2\implies (a^2-b^2)^2+4i(a-b)(a^2+b^2+ab)=a^2+b^2+4a^2b^2$. Now, since, $\text{R.H.S} \in\Bbb R$ and hence $Im(\text{L.H.S})=0$. Thus, $4(a-b)(a^2+b^2+ab)=0$ so, $a=b$ and $a^2+b^2+ab$. So all $z=a+ib$ are solutions of the equations iff $a=b$ or $\text{if}\space(x=a,y=b)$ satisfies $f(x,y)=x^2+y^2+xy=0$.

Is the above solution correct?

Assuming $z^2+|z|=0$ it follows that
$$-z^2=|z|
$$
Taking the modulus of both sides we get
$$|-z^2| = |(|z|)| \implies |z|^2=|z| \implies |z|=0 \,\,\text{or}\,\, 1
$$
Case 1: If $|z|=0$ then $z=0$. And $0$ is indeed a solution.
Case 2: If $|z|=1$ then $z^2=-1$ so $z=-i$ or $+i$. And $-i$, $+i$ are indeed both solutions.
