Solve the equation

$$
x+y=x^{2}-x y+y^{2}
$$

where $x$ and $y$ are integers.
Let $y=x+a$, where $a \in \mathbb{Z}$. Then the equation is: $x+x+a=x^{2}-x(x+a)+(x+a)^{2}$, that is,

$$
\begin{aligned}
2 x+a & =x^{2}-x^{2}-x a+x^{2}+2 x a+a^{2}, \\
0 & =x^{2}+x a-2 x+a^{2}-a, \\
0 & =x^{2}+(a-2) x+\left(a^{2}-a\right) .
\end{aligned}
$$

The solution in terms of $a$ is:

$$
x_{1,2}=\frac{-a+2 \pm \sqrt{(a-2)^{2}-4 \cdot 1 \cdot\left(a^{2}-a\right)}}{2 \cdot 1}
$$

The quadratic equation has a solution if its discriminant is non-negative:

$$
\begin{aligned}
D=(a-2)^{2}-4\left(a^{2}-a\right) & \geq 0 \\
a^{2}-4 a+4-4 a^{2}+4 a & \geq 0 \\
4-3 a^{2} & \geq 0 \\
\frac{4}{3} & \geq a^{2} \\
\frac{2}{\sqrt{3}} & \geq|a|
\end{aligned}
$$

The possible values of $a$ are:

$a=-1$, then $y=x-1, D=1$, that is, $x_{1,2}=\frac{1+2 \pm \sqrt{1}}{2}, \quad x_{1}=2, x_{2}=1$;

$a=0, \quad$ then $y=x, \quad D=4$, that is, $x_{3,4}=\frac{2 \pm \sqrt{4}}{2}, \quad x_{3}=2, x_{4}=0 ;$

$a=1, \quad$ then $y=x+1, D=1, \text{ that is } x_{5,6}=\frac{-1+2 \pm \sqrt{1}}{2}, x_{5}=1, x_{6}=0$.

If $a=-1$ and $x_{1}=2$, then $y_{1}=x_{1}-1=1$,

and $x_{2}=1$, then $y_{2}=x-1=0$.

If $a=0 \quad$ and $x_{3}=2$, then $y_{3}=x_{3}=2$,

and $x_{4}=0$, then $y_{4}=x_{4}=0$.

If $a=1 \quad$ and $x_{5}=1$, then $y_{5}=x_{5}+1=2$, and $x_{6}=0$, then $y_{6}=x_{6}+1=1$.

Thus, the solutions are the following $(x ; y)$ pairs:

$$
(2 ; 1) ; \quad(1 ; 0) ; \quad(2 ; 2) ; \quad(0 ; 0) ; \quad(1 ; 2) ; \quad(0 ; 1) .
$$