Solving a complex equation with $z=x \pm iy$ I'm trying to solve part of the question below:

The solution is below: 
I managed to get to the line $x-y=\pm 2$ , $y=\pm x$ but I can't understand how you can deduce $y=-x$ from these equations. I tried substituting them into each other but got nothing.
 A: *

*When $\text{z}\in\mathbb{C}$ and $\text{n}\in\mathbb{R}$:
$$\text{z}^2=\left|\text{z}\right|^2+\text{n}\Longleftrightarrow\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]+2\Re\left[\text{z}\right]\Im\left[\text{z}\right]i=\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]+\text{n}$$


So, you need to solve:
$$
\begin{cases}
\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]=\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]+\text{n}\\
2\Re\left[\text{z}\right]\Im\left[\text{z}\right]=0
\end{cases}\Longleftrightarrow
\begin{cases}
2\Im^2\left[\text{z}\right]+\text{n}=0\\
\Re\left[\text{z}\right]\Im\left[\text{z}\right]=0
\end{cases}
$$
For you problem, you'll find:
$$\Re\left[\text{z}\right]=0,\Im\left[\text{z}\right]=\pm\sqrt{2}$$


*When $\text{z}\in\mathbb{C}$ and $\text{n}\in\mathbb{R}$:
$$\text{z}^2=\left(\left|\text{z}\right|^2+\text{n}\right)i\Longleftrightarrow\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]+2\Re\left[\text{z}\right]\Im\left[\text{z}\right]i=\left(\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]+\text{n}\right)i$$


So, you need to solve:
$$
\begin{cases}
\Re^2\left[\text{z}\right]-\Im^2\left[\text{z}\right]=0\\
\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]+\text{n}=2\Re\left[\text{z}\right]\Im\left[\text{z}\right]
\end{cases}\Longleftrightarrow
\begin{cases}
\Re^2\left[\text{z}\right]=\Im^2\left[\text{z}\right]\\
\Re^2\left[\text{z}\right]+\Im^2\left[\text{z}\right]+\text{n}=2\Re\left[\text{z}\right]\Im\left[\text{z}\right]
\end{cases}
$$
For you problem, you'll find:
$$\Re\left[\text{z}\right]=\pm1,\Im\left[\text{z}\right]=\mp1$$
A: The equation (b) becomes
$$
x^2-y^2+2xyi=(x^2+y^2-4)i
$$
translates into the system
$$
\begin{cases}
x^2-y^2=0 \\[6px]
2xy=x^2+y^2-4
\end{cases}
$$
and both equations should be satisfied. From the second one you get $(x-y)^2=4$, so $x-y\ne0$. The first equation tells us
$$
(x-y)(x+y)=0
$$
so we get $x+y=0$. Now we have two linear systems
$$
\begin{cases}
x+y=0 \\[6px]
x-y=2
\end{cases}
\qquad\text{or}\qquad
\begin{cases}
x+y=0 \\[6px]
x-y=-2
\end{cases}
$$
that you can easily solve.
For (a) we get instead
$$
\begin{cases}
x^2-y^2=x^2+y^2-4\\[6px]
2xy=0
\end{cases}
$$
The first equation is $y^2=2$; the second equation now gives $x=0$.

A different approach. We have, for equation (a), $z^2=z\bar{z}-4$, so also $\bar{z}^2=\bar{z}z-4$. In particular, $z^2=\bar{z}^2$, so either
$z=\bar{z}$ or $z=-\bar{z}$. In the first case we obtain $z^2=z^2-4$, which has no solution, in the second case $z^2=-z^2-4$, so $z^2=-2$.
