Solve the equation $ z^2 + \left\vert z \right\vert = 0 $, where $z$ is a complex number. I've tried solving this, but I'm stuck at one point.
Here's what I did:
Let $ z = x + yi $, where $x, y \in \mathbf R$
Then , $ (x + yi)^2 + \sqrt{x^2 + y^2} = 0 $
Or, $x^2 + {(yi)}^2 + 2xyi + \sqrt{x^2 + y^2} = 0 $
Or, $ x^2 - y^2 + 2xyi + \sqrt{x^2 + y^2} = 0 + 0i$
Thus, $ x^2 - y^2 + \sqrt{x^2 + y^2} = 0\qquad\qquad\qquad\qquad\qquad\qquad\ (i)$
and $2xy = 0 \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad(ii)$
If $2xy = 0$, then either $x = 0 $ or $y = 0$
Now, if I take $ x = 0$, and subsitute in $(i)$, I get either $y = 0$ or $y  = 1$.
So far, so good, but if I take $y = 0$, and substitute in $(ii)$:
We have $x^2 + \sqrt{x^2} = 0$
so $x^2 = -\sqrt{x^2} $
or $x^2 = -x$
or $\frac{x^2}{x} = -1 $
or $x = -1$
However, this solution doesn't satistfy the equation $x^2 + \sqrt{x^2}$ or the original equation. 
What am I doing wrong here ?
 A: In $x^2 = -\sqrt{x^2}$, note that $x$ is real, so you have a non-negative on the left, and a non-positive on the right. Therefore they must both be $0$.
Alternative solution:
$$
z^2=-|z|\\
|z|^2=|z|\\
|z|=0\quad \text{or}\quad|z|=1
$$
then for $|z|=1$, solve $z^2+1=0$.
A: Let $x,y\in\mathbb{R};\;z=x+iy$ the given equation $z^2+|z|=0$ becomes
$(x+iy)^2+\sqrt{x^2+y^2}=0$
$x^2-y^2+\sqrt{x^2+y^2}+ixy=0$
which translates in the system
$\left\{
\begin{array}{l}
 x^2-y^2+\sqrt{x^2+y^2}=0 \\
 y-2 x y=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 x^2-y^2+\sqrt{x^2+y^2}=0 \\
 2xy=0 \\
\end{array}
\right.
$
Which splits into two systems
$\left\{
\begin{array}{l}
 x^2-y^2+\sqrt{x^2+y^2}=0 \\
 x=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 x^2-y^2+\sqrt{x^2+y^2}=0 \\
 y=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 -y^2+\sqrt{y^2}=0 \\
 x=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 x^2+\sqrt{x^2}=0 \\
 y=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 y^2=|\,y\,| \\
 x=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 x^2=-|\,x\,| \\
 y=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 y=0\lor y= \pm 1 \\
 x=0 \\
\end{array}
\right.
$
$\left\{
\begin{array}{l}
 x=0\\
 y=0 \\
\end{array}
\right.
$
So we have the solutions
$z=0\lor z=\pm i$
Hope this helps
