Example 14 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.
(1994 Chinese National Team Training Selection Problem)
Proof: Let $f(x) = g(x) \cdot h(x)$, where $g(x)$ and $h(x)$ are integer-coefficient polynomials with positive degrees. Since $f(x)$ is an integer-coefficient polynomial with a leading coefficient of 1, $g(x)$ and $h(x)$ are also integer-coefficient polynomials with leading coefficients of 1. Without loss of generality, assume
\[
\begin{array}{l}
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},
\end{array}
\]
where $r, s \geqslant 1$, and $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 \mid b_{0}$, then $p \mid a_{0}$.
Suppose $p \mid a_{0}, \cdots, p \mid 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_{0} b_{t} \not\equiv 0 \pmod{p}.
\]
Notice that the coefficients of the terms with degrees less than $n-1$ in $f(x)$ are all multiples of $p$, so $t \geqslant n-1$, hence $r \geqslant t \geqslant n-1$. Therefore, by $r + s = n$ and $r \geqslant 1$, we get $r = n-1, s = 1$.
Thus, $h(x) = x + b_{0}$, and $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$, so $n = 2$, which contradicts $n \geqslant 3$. Therefore, $q \nmid b_{0}$.
Since $b_{0} \mid p q$, we have $b_{0} = \pm 1$, i.e., $h(x) = x \pm 1$.
If $b_{0} = 1$, then $h(x) = x + 1$, so $f(-1) = 0$, i.e.,
\[
(-1)^{n} + a(-1)^{n-1} + p q = 0, \quad \text{and} \quad 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$, and $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 factored into the product of two integer-coefficient polynomials with positive degrees. Therefore, the values of $a$ are $a = (-1)^{n} p q + 1$ or $-p q - 1$.