Example 24([43.3]) Find all pairs of positive integers $\{m, n\}(m \geqslant 3, n \geqslant 3)$ such that there exist infinitely many positive integers $a$ for which the value of $\frac{a^{m}+a-1}{a^{n}+a^{2}-1}$ is an integer.
First, if the conclusion holds, then it must be that $m>n$ (why). By the division algorithm for polynomials, there exist integer-coefficient polynomials $q(x)$ and $r(x)$ (with degree less than $n$), such that
$$x^{m}+x-1=q(x)\left(x^{n}+x^{2}-1\right)+r(x) \text {. }$$

If there are infinitely many positive integers $a$, such that when $x=a$, $\left(x^{m}+x-1\right) /$ $\left(x^{n}+x^{2}-1\right)$ takes integer values, then by equation (1), for these infinitely many positive integers $a$, when $x=a$, $r(x) /\left(x^{n}+x^{2}-1\right)$ also takes integer values. Since the degree of $r(x)$ is less than $n$, unless $r(x)$ is identically zero, this is impossible (why). Therefore, a necessary condition for the conclusion to hold is that $r(x)$ is identically zero, i.e., the polynomial $x^{n}+x^{2}-1$ divides $x^{m}+x-1$.

Thus, setting $m=n+k, k \geqslant 1$, we obtain: A necessary condition for the conclusion to hold is that there is an integer-coefficient polynomial with leading coefficient 1 (why)
$$q(x)=\left(x^{k}+c_{k-1} x^{k-1}+c_{k-2} x^{k-2}+\cdots+c_{2} x^{2}+c_{1} x+1\right)$$

such that
$$\begin{aligned}
x^{n+k}+x-1= & \left(x^{k}+c_{k-1} x^{k-1}+c_{k-2} x^{k-2}+\cdots\right. \\
& \left.+c_{2} x^{2}+c_{1} x+1\right)\left(x^{n}+x^{2}-1\right)
\end{aligned}$$

We simplify the above equation. Subtracting $x^{k}\left(x^{n}+x^{2}-1\right)$ from both sides of the equation, we get
$$\begin{array}{l}
-(x-1)\left(x^{k+1}+x^{k}-1\right)=-x^{k+2}+x^{k}+x-1 \\
\quad=\left(c_{k-1} x^{k-1}+c_{k-2} x^{k-2}+\cdots+c_{2} x^{2}+c_{1} x+1\right)\left(x^{n}+x^{2}-1\right)
\end{array}$$

When $x=1$, $x^{n}+x^{2}-1=1$, so by equation (3) we know
$$c_{k-1} x^{k-1}+c_{k-2} x^{k-2}+\cdots+c_{2} x^{2}+c_{1} x+1=0$$

Therefore, the integer-coefficient polynomial $c_{k-1} x^{k-1}+c_{k-2} x^{k-2}+\cdots+c_{2} x^{2}+c_{1} x+1$ is divisible by $x-1$ (why). We set
$$c_{k-1} x^{k-1}+c_{k-2} x^{k-2}+\cdots+c_{2} x^{2}+c_{1} x+1=-(x-1) h(x),$$

where the integer-coefficient polynomial $h(x)$ is
$$h(x)=b_{l} x^{l}+b_{l-1} x^{l-1}+\cdots+b_{1} x+1, \quad b_{l} \neq 0, l \geqslant 0 .$$

Combining the above discussions, we get
$$\left(x^{k+1}+x^{k}-1\right)=\left(b_{l} x^{l}+b_{l-1} x^{l-1}+\cdots+b_{1} x+1\right)\left(x^{n}+x^{2}-1\right) .$$

Comparing the coefficients on both sides of the equation, we get
$$k+1=l+n, \quad b_{l}=1, l \geqslant 0$$

Since $n \geqslant 3$, it must be that $k \geqslant 2$. If $k=2$, by equation (6) we immediately get
$$l=0, \quad n=3, \quad m=5$$

Correspondingly, we have
$$x^{5}+x-1=\left(x^{3}+x^{2}-1\right)\left(x^{2}-x+1\right)$$

Next, we prove that equation (7) is the unique solution, i.e., it is impossible to have $k>2$. We use proof by contradiction. If $k>2$, let $f(x)=x^{n}+x^{2}-1$. Polynomials are continuous functions, and note that
$$f(0)=-1, \quad f(1)=1$$

By the intermediate value theorem for continuous functions, there must be a real number $\alpha(0<\alpha<1)$ such that
$$f(\alpha)=0$$

If $k>2$, then $\alpha^{2}>\alpha^{k}$ (why). From the above two inequalities, we get
$$\alpha^{k+1}>\alpha^{n}, \quad k+1<n$$

This contradicts equation (6). Proof complete.