Here's a purely algebraic derivation. Write $\ell=z+\bar{z}$. Investigate squares and cubes:
$\color{Blue}{\ell^2=}(z+\bar{z})^2=z^2+2z\bar{z}+\bar{z}^2=\color{Blue}{\ell+2}\color{Red}{r^2} \tag{1}$
$\ell=z^3+\bar{z}^3=\ell(z^2-z\bar{z}+\bar{z}^2)=\ell(\ell-r^2) $
$\implies \color{Red}{r^2=\ell-1} \tag{2}$
$\color{Blue}{\ell^2=\ell+2}\color{Red}{(\ell-1)} \implies \ell\in\{1,2\} \tag{1+2}$
Now $\ell=1\implies r=0$ corresponds to $z=0$, and $\ell=2\implies r=1$ corresponds to $z=1$ because it is the only number with both magnitude and real part equal to one.