Example 8 (1980 Leningrad Mathematical Olympiad) Find all prime numbers $p$ such that $2 p^{4}-p^{2}+16$ is a perfect square.
Solution 1 When $p=2$, $2 p^{4}-p^{2}+16=44$ is not a perfect square.
So $p$ is an odd prime.
Let $2 p^{4}-p^{2}+16=k^{2}$, where $k$ is an odd number, then $p^{2}\left(2 p^{2}-1\right)=(k-4)(k+4)$.

Since $p$ is a prime, therefore $p \mid k-4$ or $p \mid k+4$, but $p$ cannot divide both $k-4$ and $k+4$ at the same time, otherwise $p \mid(k+4)-(k-4)=8$,
which contradicts $p$ being an odd prime.
Therefore, one and only one of $k+4$ and $k-4$ can be divisible by $p^{2}$.
If $p^{2} \mid k-4$, let $k-4=s p^{2}$, where $s$ is an odd number, then
$k+4=s p^{2}+8$, thus
$p^{2}\left(2 p^{2}-1\right)=(k+4)(k-4)=s p^{2}\left(s p^{2}+8\right)$, that is
$s\left(s p^{2}+8\right)=2 p^{2}-1$, that is
$\left(s^{2}-2\right) p^{2}=-8 s-1$.
The right side of this equation is negative, so there can only be $s=1$.
At this time $p^{2}=9, p=3$.
And when $p=3$, $2 p^{4}-p^{2}+16=169$ is a perfect square.
If $p^{2} \mid k+4$, let $k+4=s p^{2}$, then $s$ is an odd number, then
$k-4=s p^{2}-8$,
$\left(s^{2}-2\right) p^{2}=8 s-1$.
When $s=1$, we have $-p^{2}=7$, which is impossible.
When $s \geqslant 3$, since
$$
\begin{aligned}
\left(s^{2}-2\right) p^{2} & >\left(s^{2}-4\right) p^{2}=(s+2)(s-2) p^{2} \geqslant 5 \cdot 9(s-2) \\
& =(8 s-1)+(37 s-89) \geqslant(8 s-1)+(111-89)>8 s-1 .
\end{aligned}
$$

This also leads to a contradiction.
In summary, $2 p^{4}-p^{2}+16$ is a perfect square if and only if $p=3$.
Solution 2 When $p=2$, $2 p^{4}-p^{2}+16=44$ is not a perfect square.
When $p \geqslant 3$, if $3 \times p$, then
$$
\begin{array}{l}
p^{2} \equiv 1(\bmod 3), \\
2 p^{4}-p^{2}+16 \equiv 2(\bmod 3),
\end{array}
$$

At this time, $2 p^{4}-p^{2}+16$ is not a perfect square.
Thus, $3 \mid p$, and since $p$ is a prime, so $p=3$.
And when $p=3$, $2 p^{4}-p^{2}+16=169$ is a perfect square.