Let $p$ be a prime number satisfying $p \equiv 3(\bmod 8)$. Find all integer solutions $(x, y)$ to the equation $y^{2}=x^{3}-p^{2} x$. (2007, Indian National Team Selection Exam)
The original equation is equivalent to
$$
y^{2}=(x-p)(x+p) x \text {. }
$$

We discuss the following cases. All letters in the discussion below are natural numbers.
(1) $p \nmid y$.

Since $(x-p, x)=(x+p, x)=1$, if $x$ is even, then $(x-p, x+p)=1$. In this case, $x$, $x+p$, and $x-p$ are all perfect squares, but
$$
x+p \equiv 3 \text { or } 7(\bmod 8),
$$

which is a contradiction.
Therefore, $x$ is odd, and in this case, $(x-p, x+p)=2$.
Let $x=r^{2}, x-p=2 s^{2}, x+p=2 t^{2}$.
Since $(x+p)-(x-p)=2 p \equiv 2(\bmod 4)$,

we have $s^{2}-t^{2} \equiv 1(\bmod 2)$.
Thus, one of $s^{2}$ and $t^{2}$ is even.
Consequently, one of $s$ and $t$ is even.
Then $r^{2}=x=2 s^{2}+p=2 t^{2}-p \equiv 3$ or $5(\bmod 8)$, which is impossible.
Therefore, when $p \nmid y$, the original equation has no solutions.
(2) $p \mid y$.
If $y=0$, it is easy to see that the original equation has three solutions:
$(0,0),(p, 0),(-p, 0)$.
Assume $y \neq 0$. Since $p \mid y$, we have
$(x-p, x, x+p)=p \Rightarrow p^{2} \mid y$.
Let $x=p a, y=p^{2} b$. Then the original equation becomes
$p b^{2}=(a-1) a(a+1)=a\left(a^{2}-1\right)$.
Clearly, $\left(a, a^{2}-1\right)=1$.
Next, we prove that equation (1) has no positive integer solutions.
(i) If $p \mid a$, then
$a=p c^{2}, a^{2}-1=d^{2}$
$\Rightarrow a^{2}-d^{2}=1 \Rightarrow(a+d)(a-d)=1$
$\Rightarrow a=1, d=0 \Rightarrow b=0$.
This is a contradiction.
(ii) If $p \nmid a$, then
$a=c^{2}, a^{2}-1=p d^{2}$
$\Rightarrow p d^{2}=c^{4}-1=\left(c^{2}+1\right)(c+1)(c-1)$.
When $c$ is even, $d$ is odd.
Thus, $c^{4}-1=-1(\bmod 8)$.
But $p d^{2} \equiv 3 \times 1 \equiv 3(\bmod 8)$, which is a contradiction.
Therefore, $c$ is odd.
Thus, $\left(c^{2}+1, c^{2}-1\right)=2,(c-1, c+1)=2$.
Since $p \equiv 3(\bmod 4)$, we have
$c^{2} \neq-1(\bmod p) \Rightarrow p \nmid\left(c^{2}+1\right)$.
Also, $c^{2} \equiv 1(\bmod 8)$
$\Rightarrow c^{2}+1=2(\bmod 8), c^{2}-1=0(\bmod 8)$.
Hence, $c^{4}-1=p d^{2} \Leftrightarrow\left\{\begin{array}{l}c^{2}+1=2 e^{2}, \\ c^{2}-1=8 p f^{2},\end{array}\right.$

where $e$ is odd, and let $c$ be the smallest positive integer $x$ in all integer solutions $(x, y)$ of the Pell equation
$x^{2}-1=8 p y^{2}$.
Since $c^{2}+1=2 e^{2}=2(\bmod 16)$
$\Rightarrow c^{2} \equiv 1(\bmod 16) \Rightarrow c \equiv \pm 1(\bmod 8)$.
Thus, $c^{2}-1=(c-1)(c+1)=8 p f^{2}$ has the following four cases:
$$
\begin{array}{l}
\text { 1) }\left\{\begin{array} { l } 
{ c - 1 = 2 p g ^ { 2 } , } \\
{ c + 1 = 4 h ^ { 2 } ; }
\end{array} \quad \text { 2) } \left\{\begin{array}{l}
c-1=2 g^{2}, \\
c+1=4 p h^{2} ;
\end{array}\right.\right. \\
\text { 3) }\left\{\begin{array} { l } 
{ c + 1 = 2 p g ^ { 2 } , } \\
{ c - 1 = 4 h ^ { 2 } ; }
\end{array} \text { 4) } \left\{\begin{array}{l}
c+1=2 g^{2}, \\
c-1=4 p h^{2} .
\end{array}\right.\right. \\
\end{array}
$$

where $g$ is odd.
1) $c=4 h^{2}-1 \equiv-1(\bmod 8)$
$\Rightarrow 4 h^{2}=c+1 \equiv 0(\bmod 8) \Rightarrow h$ is even.
Thus, $c=4 h^{2}-1=-1(\bmod 16)$
$\Rightarrow 2 p g^{2}=c-1 \equiv-2(\bmod 16)$.
Hence, $p g^{2}=-1(\bmod 8)$.
But $p g^{2} \equiv 3 \times 1 \equiv 3(\bmod 8)$, which is a contradiction.
2) $c=2 g^{2}+1=3(\bmod 8)$, which is a contradiction.
3) $c=4 h^{2}+1 \equiv 1(\bmod 8)$
$\Rightarrow 2 p g^{2}=c+1 \equiv 2(\bmod 8)$.
But $2 p g^{2}=2 \times 3 \times 1 \equiv 6(\bmod 8)$, which is a contradiction.
4) $c=2 g^{2}-1 \equiv 2-1 \equiv 1(\bmod 16)$
$\Rightarrow 4 p h^{2}=c-1 \equiv 0(\bmod 16)$.
Thus, $h$ is even.
Let $h=2 k$. Then $g^{2}-1=2 p h^{2}=8 p k^{2}$.
Therefore, $g=\sqrt{\frac{c+1}{2}}$ is a solution to equation (2), and
$\sqrt{\frac{c+1}{2}} \leqslant c$.
By the minimality of $c$, we have
$\sqrt{\frac{c+1}{2}}=c \Rightarrow c=1 \Rightarrow a=1 \Rightarrow b=0$, which is a contradiction.
In summary, the equation has only three solutions:
$(0,0),(p, 0)(-p, 0)$.