Example 9 Let $p, q$ be distinct primes, and let $n \geqslant 3$ be a positive integer. Find all integers $a$ such that the polynomial $f(x)=x^{n}+a x^{n-1}+p q$ can be factored into the product of two polynomials with positive degrees and integer coefficients.
Analysis Note that $p, q$ are different primes, and use the divisibility of the coefficients of the polynomial terms to determine the degrees and coefficients of the two positive-degree integer-coefficient polynomials that the polynomial $f(x)$ decomposes into.

Solution Let $f(x)=g(x) \cdot h(x)$, where $g(x)$ and $h(x)$ are positive-degree integer-coefficient polynomials. Since $f(x)$ is an integer-coefficient polynomial with a leading coefficient of 1, the leading coefficients of $g(x)$ and $h(x)$ are also 1. Without loss of generality, let $g(x)=x^{r}+a_{r-1} x^{r-1}+\cdots+a_{0}, h(x)=x^{s}+b_{s-1} x^{s-1}+\cdots+b_{0}$, where $r, s \geqslant 1$ and $r+s=n$, $a_{0}, a_{1}, \cdots, a_{r-1}, b_{0}, b_{1}, \cdots, b_{s-1}$ are integers. Thus, $a_{0} b_{0}=p q$, so $p$ divides $a_{0}$ or $b_{0}$, but not both. Without loss of generality, assume $p \nmid b_{0}$, then $p \mid a_{0}$.
Assume $p\left|a_{0}, \cdots, p\right| a_{t-1}, p \nmid a_{t}$, then the coefficient of the $t$-th term in $g(x) \cdot h(x)$ is
$$
a_{t} b_{0}+a_{t-1} b_{1}+\cdots+a_{1} b_{t-1}+a_{0} b_{t} \equiv a_{t} b_{0} \not \equiv 0(\bmod p) .
$$

Notice that the coefficients of the terms with degree less than $n-1$ in $f(x)$ are all multiples of $p$. Therefore, $t \geqslant n-1$. So $r \geqslant t \geqslant n-1$.
Thus, from $r+s=n$ and $r, s \geqslant 1$, we get $r=n-1, s=1$. Therefore, $h(x)=x+b_{0}, p \nmid b_{0}$.
On the other hand, $q \mid a_{0} b_{0}$. If $q \mid b_{0}$, then similarly we can prove $s=n-1$. Thus $n=2$, which contradicts $n \geqslant 3$. Therefore, $q \nmid b_{0}$. Since $b_{0} \mid p q$, we have $b_{0}= \pm 1$, so $h(x)=x \pm 1$.

If $b_{0}=1$, then $h(x)=x+1$, so $f(-1)=0$, i.e., $(-1)^{n}+a \cdot(-1)^{n}+p q=0$, thus $a=(-1)^{n} p q+1$.
If $b_{0}=-1$, then $h(x)=x-1$, so $f(1)=0$, i.e., $1+a+p q=0$, thus $a=-p q-1$.
It is easy to verify that when $a=(-1)^{n} p q+1$ or $a=-p q-1$, $f(x)$ can be decomposed into the product of two positive-degree integer-coefficient polynomials. Therefore, the values of $a$ are $(-1)^{n} p q+1$ or $-p q-1$.