$\mathbb{Z}[x]$ represents the set of all polynomials with integer coefficients. Find all functions $f:\mathbb{Z}[x]\rightarrow \mathbb{Z}[x]$ such that for any 2 polynomials $P,Q$ with integer coefficients and integer $r$, the following statement is true. \[P(r)\mid Q(r) \iff f(P)(r)\mid f(Q)(r).\]

(We define $a|b$ if and only if $b=za$ for some integer $z$. In particular, $0|0$.)

[i]Proposed by the4seasons.[/i]
1. **Understanding the Problem:**
   We need to find all functions \( f: \mathbb{Z}[x] \rightarrow \mathbb{Z}[x] \) such that for any two polynomials \( P, Q \) with integer coefficients and any integer \( r \), the following statement holds:
   \[
   P(r) \mid Q(r) \iff f(P)(r) \mid f(Q)(r).
   \]
   Here, \( \mathbb{Z}[x] \) represents the set of all polynomials with integer coefficients.

2. **Initial Observations:**
   - If \( P(r) \mid Q(r) \), then \( f(P)(r) \mid f(Q)(r) \) must hold for all \( r \in \mathbb{Z} \).
   - Conversely, if \( f(P)(r) \mid f(Q)(r) \), then \( P(r) \mid Q(r) \) must hold for all \( r \in \mathbb{Z} \).

3. **Lemma:**
   Let \( P, Q \in \mathbb{Z}[x] \) such that \( P(n) \mid Q(n) \) for infinitely many \( n \in \mathbb{Z} \). Then \( \frac{P(x)}{Q(x)} \in \mathbb{Q}[x] \).

   **Proof of Lemma:**
   Suppose otherwise. By the division algorithm, we can write:
   \[
   \frac{P(x)}{Q(x)} = A(x) + \frac{B(x)}{Q(x)}
   \]
   for some \( A(x), B(x) \in \mathbb{Z}[x] \) with \( B \not\equiv 0 \) and \( \deg B < \deg Q \). By picking some \( M \) such that \( MA(x) \in \mathbb{Z}[x] \), we get:
   \[
   \frac{MB(n)}{Q(n)} \in \mathbb{Z}
   \]
   for infinitely many \( n \). This is impossible for large \( |n| \) due to size reasons. Hence, the lemma is proved. \(\blacksquare\)

4. **Key Fact:**
   \[
   |P(n)| = |Q(n)| \iff |f(P)(n)| = |f(Q)(n)|
   \]

   **Proof of Key Fact:**
   Swap \( P \) and \( Q \). This implies that if \( f(P) \equiv f(Q) \), then \( |P| \equiv |Q| \), i.e., \( f \) is "pseudo-injective".

5. **Finding \( f(0) \):**
   Suppose \( f(0) \) is nonzero. Then \( P(n) \mid 0 \implies f(P)(n) \mid f(0)(n) \) for all \( n \). This implies \( \deg f(P) \leq \deg f(0) \) for all \( P \). Pick \( k = \deg P + 1 \) integers \( x_0, \ldots, x_k \) such that \( f(0)(x_i) \neq 0 \). Each \( f(P)(x_i) \) can only attain finitely many values. By Lagrange interpolation, \( f(P) \) can only equal finitely many integer polynomials, contradicting pseudo-injectivity since \( |\mathbb{Z}[x]| = \infty \). Thus, \( f(0) \equiv 0 \).

6. **Integer Roots:**
   The integer roots of \( f(P) \) are the same as those of \( P \). If \( P(r) = 0 \), then \( 0 \mid P(r) \implies 0 \mid f(P)(r) \), and the reverse follows similarly.

7. **Factoring Out \( f(1) \):**
   For any polynomial \( P \), we have \( f(1) \mid f(P) \). Note that \( f(1) \) has no integer roots, so we may factor it out and suppose \( f(1) \) is constant. For all \( k \) and \( c \), we have \( f(k)(n) \mid f(x-c)(n) \) whenever \( n \equiv c \pmod{k} \). Hence, \( f(k) \mid f(x-c) \) in the polynomial sense.

8. **Degree of \( f(k) \):**
   Suppose some \( k \) has \( \deg f(k) > 0 \). Let \( A \in \mathbb{Z}[x] \) denote its primitive part. Then \( \frac{f(x-c)}{A} \) should be an integer polynomial by Gauss' lemma. But then:
   \[
   (c+1) - c = 1 \implies |f(1)(c+1)| = |f(x-c)(c+1)| \implies A(c+1) \mid f(1),
   \]
   which is absurd as \( f(1) \not\equiv 0 \). Hence, \( f(k) \) is identically constant.

9. **Form of \( f(x) \):**
   Note that \( i \mid j \implies f(i) \mid f(j) \) (in the integer sense). Also, \( |f(i)(i)| = |f(x)(i)| \), so \( i \mid j \implies f(x)(i) \mid f(x)(j) \). In particular, \( \frac{f(x)(2n)}{f(x)(n)} \) is an integer for all \( n \neq 0 \). It must be identically constant. If \( r \in \mathbb{C} \) is a root of \( f(x) \), so is \( 2r \). Iterating this implies that \( f(x) \) has infinitely many roots (impossible) unless its roots are all \( 0 \), i.e., \( f(x) \) is of the form \( cx^d \). Hence, \( f(n) \equiv \pm cn^d \) for some fixed \( c, d \). By pseudo-injectivity, \( d \geq 1 \), and from \( n = 1 \), it follows that \( c \in \mathbb{Z} \).

10. **Final Form of \( f(P) \):**
    For any \( P \in \mathbb{Z}[x] \) and \( n \in \mathbb{Z} \), we should have:
    \[
    |f(P)(n)| = |f(P(n))(n)| \implies f(P)(n) = \pm cP(n)^d,
    \]
    so \( f(P) \equiv \pm cP(n)^d \). Multiplying the primitive part of \( f(1) \) back in, we obtain the advertised solution set. \(\blacksquare\)

The final answer is \( \boxed{ f(P) = \pm AP^d } \) where \( d > 0 \) is a fixed integer and \( A \) is a fixed integer polynomial with no integer roots.