Example 3 Find all non-zero integer solutions $(a, b)$ of the indeterminate equation
$$
\left(a^{2}+b\right)\left(a+b^{2}\right)=(a-b)^{2}
$$

Solution (1) $a=b$.
Then $a^{2}+b=0$ or $a+b^{2}=0$.
Thus, $a=b=0$ (discard) or $a=b=-1$.
(2) $a \neq b$.
When $a=0$, we get $b=1$;
When $b=0$, we get $a=1$.
Now consider the case where both $a$ and $b$ are non-zero.
(i) $a>b>0$.
Then $a^{2}<\left(a^{2}+b\right)\left(a+b^{2}\right)=(a-b)^{2}<a^{2}$.
Contradiction.
(ii) $a>0>b$.

Let $b=-c$. Then $c>0$.
Thus, $\left(a^{2}-c\right)\left(a+c^{2}\right)=(a+c)^{2}$.
When $c=1$, $a^{2}-1=a+1$.
Therefore, $a=2, b=-1$.
When $c>1$, let $(a, c)=d, a=d a_{1}, c=d c_{1}$. Then $\left(a_{1}, c_{1}\right)=1$.
The original indeterminate equation transforms to
$$
a^{3}-a^{2}=c^{3}+c^{2}-a^{2} c^{2}+3 a c \text {. }
$$

Thus, $d^{2} c_{1} \mid\left(a^{3}-a^{2}\right)$, i.e., $c_{1} \mid a_{1}^{2}(a-1)$.
Therefore, $c_{1} \mid (a-1)$.
From $(a+c)^{2}=\left(a^{2}-c\right)\left(a+c^{2}\right)$
$$
>\left(a^{2}-c\right)(a+c),
$$

we get $a+c>a^{2}-c$.
Thus, $2>\frac{a(a-1)}{c}=\frac{a_{1}(a-1)}{c_{1}}$.
Therefore, $a_{1}=1, a-1=c_{1}$.
Thus, $c=d c_{1}=a(a-1)$.
Substituting into equation (1) we get
$$
a\left[a+a^{2}(a-1)^{2}\right]=a^{4} \text {. }
$$

Thus, $a=1, c=0$, which is a contradiction.
(iii) $ab' \geqslant 1$, so,
$$
\begin{array}{l}
\left(a'-b'\right)^{2}=\left(a'^{2}-b'\right)\left(b'^{2}-a'\right) \\
>\left(a'-b'\right)\left(b'^{2}-a'\right),
\end{array}
$$

i.e., $a'-b'>b'^{2}-a'$.
Thus, $2>\frac{b'\left(b'+1\right)}{a'}$.
Let $\left(a', b'\right)=d, a'=d a_{1}, b'=d b_{1}$.
Then $d^{2} a_{1} \mid b'^{2}\left(b'+1\right)$, i.e., $a_{1} \mid b_{1}^{2}\left(b'+1\right)$.
Therefore, $a_{1} \mid\left(b'+1\right)$.
From $2>\frac{b_{1}\left(b'+1\right)}{a_{1}}$, we get $b_{1}=1, a_{1}=b'+1$.
Thus, $a'=b'\left(b'+1\right), b'=d$, and $b'^{2}-a'=-b'<0$,

which is a contradiction.
In summary, the integer solutions that satisfy the problem are
$$
(a, b, c)=(2,-1,1) .
$$