Let $n$ be a positive integer, with prime factorization $$n = p_1^{e_1}p_2^{e_2} \cdots p_r^{e_r}$$ for distinct primes $p_1, \ldots, p_r$ and $e_i$ positive integers. Define $$rad(n) = p_1p_2\cdots p_r,$$ the product of all distinct prime factors of $n$. 

Find all polynomials $P(x)$ with rational coefficients such that there exists infinitely many positive integers $n$ with $P(n) = rad(n)$.
1. **Understanding the Problem:**
   We need to find all polynomials \( P(x) \) with rational coefficients such that there exist infinitely many positive integers \( n \) with \( P(n) = \text{rad}(n) \), where \( \text{rad}(n) \) is the product of all distinct prime factors of \( n \).

2. **Analyzing the Polynomial:**
   Let's consider the polynomial \( P(x) \). Since \( P(x) \) has rational coefficients, we can write it in the form:
   \[
   P(x) = \frac{a_k}{b_k} x^k + \frac{a_{k-1}}{b_{k-1}} x^{k-1} + \cdots + \frac{a_1}{b_1} x + \frac{a_0}{b_0}
   \]
   where \( a_i \) and \( b_i \) are integers.

3. **Behavior of \( \text{rad}(n) \):**
   For a positive integer \( n \) with prime factorization \( n = p_1^{e_1} p_2^{e_2} \cdots p_r^{e_r} \), the radical \( \text{rad}(n) \) is given by:
   \[
   \text{rad}(n) = p_1 p_2 \cdots p_r
   \]
   Since \( \text{rad}(n) \leq n \) and \( \text{rad}(n) \) is a product of distinct primes, it grows slower than \( n \).

4. **Degree of \( P(x) \):**
   To satisfy \( P(n) = \text{rad}(n) \) for infinitely many \( n \), the polynomial \( P(x) \) must grow at a rate comparable to \( \text{rad}(n) \). This implies that the degree of \( P(x) \) must be 1 or 0. If the degree were higher, \( P(n) \) would grow faster than \( \text{rad}(n) \), which is not possible.

5. **Case 1: \( P(x) \) is a constant polynomial:**
   Let \( P(x) = k \), where \( k \) is a constant. For \( P(n) = \text{rad}(n) \) to hold for infinitely many \( n \), \( k \) must be a square-free number (a product of distinct primes). This is because \( \text{rad}(n) \) is always square-free.

6. **Case 2: \( P(x) \) is a linear polynomial:**
   Let \( P(x) = \frac{a}{b} x + \frac{c}{d} \). For \( P(n) = \text{rad}(n) \) to hold for infinitely many \( n \), we need:
   \[
   \frac{a}{b} n + \frac{c}{d} = \text{rad}(n)
   \]
   For large \( n \), \( \text{rad}(n) \) must divide \( n \). This implies that \( \frac{c}{d} \) must be 0, otherwise, the term \( \frac{c}{d} \) would prevent \( \text{rad}(n) \) from dividing \( n \) for large \( n \). Thus, \( c = 0 \).

7. **Simplifying the Linear Polynomial:**
   With \( c = 0 \), we have:
   \[
   P(x) = \frac{a}{b} x
   \]
   For \( P(n) = \text{rad}(n) \) to hold, \( \frac{a}{b} \) must be 1, otherwise, \( P(n) \) would not match \( \text{rad}(n) \). Thus, \( a = b \), and we get:
   \[
   P(x) = x
   \]

8. **Conclusion:**
   The polynomials \( P(x) \) that satisfy the given condition are:
   \[
   P(x) = \frac{x}{b} \quad \text{for any positive integer } b
   \]
   and
   \[
   P(x) = k \quad \text{for any square-free integer } k.
   \]

The final answer is \( \boxed{ P(x) = \frac{x}{b} } \) for any positive integer \( b \) or \( P(x) = k \) for any square-free integer \( k \).