Example 8 Let positive rational numbers $a, b$ satisfy
$$
a+b=a^{2}+b^{2}=s \text {. }
$$

If $s$ is not an integer, then denote
$$
s=\frac{m}{n}\left(m, n \in \mathbf{Z}_{+},(m, n)=1\right) .
$$

Let $p$ be the smallest prime factor of $n$. Find the smallest possible value of $p$. ${ }^{[2]}$
(33rd Argentine Mathematical Olympiad)
Let $a=\frac{x}{z}, b=\frac{y}{z}$, where $z$ is the least common multiple of the denominators of the reduced fractions $a$ and $b$.
This implies that if $a=\frac{x^{\prime}}{z^{\prime}}, b=\frac{y^{\prime}}{z^{\prime}}$, then $z^{\prime} \geqslant z$.
We now prove: $(x, y, z)=1$.
Assume there exists a prime $q$ such that $q \mid(x, y, z)$.
Let $x^{\prime}=\frac{x}{q}, y^{\prime}=\frac{y}{q}, z^{\prime}=\frac{z}{q}$.
Then $x^{\prime}, y^{\prime}, z^{\prime} \in \mathbf{Z}_{+}$, and $a=\frac{x^{\prime}}{z^{\prime}}, b=\frac{y^{\prime}}{z^{\prime}}, z^{\prime}<z$.
This contradicts $z^{\prime} \geqslant z$.
By $s=a+b \Rightarrow \frac{m}{n}=\frac{x+y}{z}$.
Since $(m, n)=1$, it follows that $n|z \Rightarrow p| z$.
By $a+b=a^{2}+b^{2}$
$\Rightarrow z(x+y)=x^{2}+y^{2}$.
(1) If $p=2$, then $z$ is even, and $x^{2}+y^{2}$ is even. Since $(x, y, z)=1$, $x, y, z$ cannot all be even.
Thus, $x, y$ are both odd,
$$
\begin{array}{l}
x^{2}+y^{2} \equiv 1+1=2(\bmod 4), 2|z, 2|(x+y) \\
\Rightarrow z(x+y) \equiv 0(\bmod 4),
\end{array}
$$

which is a contradiction.
(2) If $p=3$, then
$$
x^{2}+y^{2}=z(x+y) \equiv 0(\bmod 3).
$$

Since $x^{2} \equiv 0,1(\bmod 3), y^{2} \equiv 0,1(\bmod 3)$, it holds only when $x^{2} \equiv 0(\bmod 3)$ and $y^{2} \equiv 0(\bmod 3)$. In this case, $3|z, 3| x, 3 \mid y$ contradicts $(x, y, z)=1$.
In summary, $p \geqslant 5$.
Taking $s=\frac{8}{5}$, then $p=5$, at this point, $a=\frac{2}{5}, b=\frac{6}{5}$ satisfies the condition.
Therefore, the minimum value of $p$ is 5.
[Analysis] To solve the problem of finding the smallest prime number, generally, the primes can be listed in ascending order and checked one by one. If the remainder of the sum of the squares of two numbers divided by 3 (or 4) is certain, then the remainder of the squares of these two numbers divided by 3 (or 4) is also certain. For this problem, when $p=5$, consider $z=5$, find the solution to $x^{2}-5 x+y^{2}-5 y=0$ to complete the solution.