This isn't true: Consider $$x = \cos \frac{\pi}{8}, \qquad y = \sin \frac{\pi}{8}. \qquad(\ast)$$ Then, substituting gives
$$x^2 - y^2 = \left(\cos \frac{\pi}{8}\right)^2 - \left(\sin \frac{\pi}{8}\right)^2 = \cos\left[2 \left( \cos \frac{\pi}{8}\right)\right] = \cos \frac{\pi}{4} = \frac{1}{\sqrt{2}}.$$ On the other hand,
$$2xy = 2 \left(\sin \frac{\pi}{8}\right) \left(\cos \frac{\pi}{8}\right) = \sin\left[2\left(\frac{\pi}{8}\right)\right] = \sin \frac{\pi}{4} = \frac{1}{\sqrt{2}}.$$
So, we have $x^2 - y^2 = 2xy$ but, since $\cos \theta > \sin \theta$ on $\left[0, \frac{\pi}{4}\right) \ni \frac{\pi}{8}$, we have $x \neq y$.
Note that the original equation just says that
$$\Re(z^2) = \Im(z^2)$$
for some complex number $z := x + iy$, so, we must have $\arg (z^2) = \frac{\pi}{4} + \pi k$ for some integer $k$ (or $z = 0$). Thus, the solutions $(x, y)$ to the given equation correspond exactly to the points $z := x + iy$ with $\arg z = \frac{\pi}{8} (4 k + 1)$ for some integer $k$ (and $(0, 0)$), and so $(\ast)$ is actually the unique solution up to a common scaling of $x, y$ and the evident quarter-turn symmetry, $(x, y) \mapsto (-y, x)$.
Edit The condition has been changed by OP to $$x^2 \color{red}{+} y^2 = 2xy,$$ and handling this is much easier: Rearranging gives $$0 = x^2 - 2xy + y^2 = (x - y)^2,$$
so $x - y = 0$ and thus $x = y$ as desired.