Hint : Assume that $z = x + i(y)$, where $x,y \in \mathbb{R}.$
Then express both $(z^2)$ and $|z|$ in terms of $x$ and $y$.
Then use the expressions to create an equation between $x$ and $y$.
Then, (if possible), simplify the equation as much as possible.
Hint (Alternate):
First check if $z = 0$ fits the constraint.
Then, (separately) assume that $|z| = r$, where $r \in \mathbb{R^+}.$
Then, assume that $z = r(\cos \theta + i\sin \theta),$ where
$\theta \in (-\pi, \pi].$
Then, set up an equation between $r$ and $\theta$ (if possible).
Then, try to simplify this equation.