Solve the following system of equations in the set of real numbers:

$$
\begin{aligned}
& x^{2}+y^{3}=x+1 \\
& x^{3}+y^{2}=y+1
\end{aligned}
$$
Solution. Subtracting the second equation from the first, then rearranging and factoring:

$$
\begin{aligned}
x^{2}-x^{3}+y^{3}-y^{2} & =x-y \\
\left(x^{2}-y^{2}\right)-\left(x^{3}-y^{3}\right)-(x-y) & =0 \\
(x-y)\left(x+y-x^{2}-x y-y^{2}-1\right) & =0
\end{aligned}
$$

The product is zero if and only if one of its factors is zero.

1. case: $x-y=0$, i.e., $x=y$. Substituting into the first equation (or any of the two identical equations) and rearranging:

$$
\begin{aligned}
x^{2}+x^{3} & =x+1 \\
(x+1)\left(x^{2}-1\right) & =0
\end{aligned}
$$

From this, $x_{1}=y_{1}=1$ and $x_{2}=y_{2}=-1$.

2. case:

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

Writing this as a quadratic equation in $x$:

$$
x^{2}+(y-1) x+\left(y^{2}-y+1\right)=0
$$

The discriminant of this quadratic equation is:

$$
(y-1)^{2}-4\left(y^{2}-y+1\right)=-3 y^{2}+2 y-3=-3\left(y-\frac{1}{3}\right)^{2}-\frac{8}{3}<0
$$

Therefore, in this case, we do not get any solutions.