Determine all polynomials $f$ with integer coefficients with the property that for any two distinct primes $p$ and $q$, $f(p)$ and $f(q)$ are relatively prime.
1. **Assume the form of the polynomial \( f \):**
   Let \( f(x) = x^m g(x) \) for some \( g \in \mathbb{Z}[x] \) with \( g(0) \neq 0 \) and \( m \in \mathbb{Z}_+ \). This is a general form where \( f(x) \) is factored into a monomial \( x^m \) and another polynomial \( g(x) \).

2. **Consider the case when \( \deg g = 0 \):**
   If \( \deg g = 0 \), then \( g(x) \) is a constant polynomial, say \( g(x) = a \). Therefore, \( f(x) = ax^m \). For \( f(p) \) and \( f(q) \) to be relatively prime for any distinct primes \( p \) and \( q \), \( a \) must be \( \pm 1 \). This is because if \( a \) had any other integer value, \( f(p) \) and \( f(q) \) would share a common factor \( a \), violating the condition that they are relatively prime.

3. **Consider the case when \( \deg g > 0 \):**
   If \( \deg g > 0 \), then \( g(x) \) is a non-constant polynomial. It is known that there are infinitely many primes dividing the different values of \( g(n) \) for \( n \in \mathbb{N} \). Let \( r \) be such a prime that divides some \( g(n) \) and \( \gcd(r, g(0)) = 1 \). This ensures that \( r \) does not divide \( g(0) \).

4. **Use Dirichlet's theorem on arithmetic progressions:**
   Consider the arithmetic progression \( \{n + kr \mid k = 0, 1, 2, \ldots\} \). By Dirichlet's theorem, this progression contains infinitely many primes. Let \( p \) and \( q \) be two such primes. Since \( p \) and \( q \) are in the form \( n + kr \), we have \( g(p) \equiv g(q) \pmod{r} \).

5. **Contradiction for \( \deg g > 0 \):**
   Since \( g(p) \equiv g(q) \pmod{r} \), \( g(p) \) and \( g(q) \) share a common factor \( r \). This contradicts the requirement that \( f(p) \) and \( f(q) \) are relatively prime for distinct primes \( p \) and \( q \). Therefore, \( \deg g \) cannot be greater than 0.

6. **Conclusion:**
   The only possible form for \( f(x) \) is when \( \deg g = 0 \), which means \( f(x) = \pm x^m \) for some \( m \in \mathbb{Z}_+ \).

The final answer is \( \boxed{ f(x) = \pm x^m } \) for some \( m \in \mathbb{Z}_+ \).