5. Determine all integer-coefficient polynomials $P(x)$ such that for all real numbers $s, t$, if $P(s), P(t)$ are integers, then $P(st)$ is also an integer.
5. $P(x)= \pm x^{n}+k(n \in \mathbf{N}, k \in \mathbf{Z})$.

Notice that if $P(x)$ is a solution, then for any integer $k$, $-P(x)+k$ and $P(x)+k$ are also solutions.

Thus, we can assume that the leading coefficient of $P(x)$ is positive and $P(0)=0$, i.e.,
$P(x)=\sum_{i=1}^{n} a_{i} x^{i}\left(a_{n}>0\right)$.
Take a prime $p>\sum_{i=1}^{n}\left|a_{i}\right|$.
Since the leading coefficient of $P(x)$ is positive, there exists $t \in \mathbf{R}$ such that $P(t)=p$.

Let $f(x)=(P(x)-p, P(2 x)-P(2 t))$ be the monic greatest common divisor. Then $(x-t) \mid f(x)$.

By the assumption that $P(2 t)$ is an integer, $f(x)$ is a non-constant polynomial with rational coefficients.

Let $P(x)-p=f(x) g(x)$, where $g(x)$ is a non-constant polynomial.
By Gauss's lemma,
$$
P(x)-p=f_{1}(x) g_{1}(x),
$$

where $f_{1}$ and $g_{1}$ are constant multiples of $f$ and $g$ with integer coefficients.
Note that the constant term of $P(x)-p$ is $-p$.
Thus, one of $f_{1}$ and $g_{1}$ has a constant term of $\pm 1$.
By Vieta's formulas, $P(x)-p$ has at least one root $r$ with modulus no greater than 1.
$$
\begin{array}{l}
\text { and }|P(r)-p|=\left|\sum_{i=1}^{n} a_{i} r^{i}-p\right| \\
>p-\sum_{i=1}^{n}\left|a_{i}\right|>0,
\end{array}
$$

which is a contradiction.
Thus, $a_{n} f(x)=P(x)-p$.
Hence, $P(2 x)-P(2 t)$ is a constant multiple of $P(x)-p$.
Comparing the leading coefficients, we get
$$
P(2 x)-P(2 t)=2^{n}(P(x)-p) \text {. }
$$

By comparing coefficients, we obtain $P(x)=a_{n} x^{n}$.
Let $a=b=\left(a_{n}\right)^{-\frac{1}{n}}$, then
$$
P(a)=P(b)=1
$$
$\Rightarrow P(a b)=\frac{1}{a_{n}} \in \mathbf{Z}$
$$
\Rightarrow a_{n}=1 \text {. }
$$

The conclusion is proved.