Find all polynomials $P(x)$ and $Q(x)$ with real coefficients such that
$$P(Q(x))=P(x)^{2017}$$
for all real numbers $x$.
To find all polynomials \( P(x) \) and \( Q(x) \) with real coefficients such that 
\[ P(Q(x)) = P(x)^{2017} \]
for all real numbers \( x \), we proceed as follows:

1. **Degree Analysis**:
   - Let \( \deg(P(x)) = m \) and \( \deg(Q(x)) = n \).
   - The degree of the left-hand side \( P(Q(x)) \) is \( m \cdot n \).
   - The degree of the right-hand side \( P(x)^{2017} \) is \( 2017 \cdot m \).
   - Equating the degrees, we get:
     \[ m \cdot n = 2017 \cdot m \]
   - If \( m \neq 0 \), we can divide both sides by \( m \):
     \[ n = 2017 \]

2. **Form of \( P(x) \)**:
   - Suppose \( P(x) \) has roots \( z_1, z_2, \ldots, z_k \) with multiplicities \( a_1, a_2, \ldots, a_k \) respectively. Then:
     \[ P(x) = c(x - z_1)^{a_1} (x - z_2)^{a_2} \cdots (x - z_k)^{a_k} \]
     where \( c \) is a non-zero constant.

3. **Substitution into the Functional Equation**:
   - Substituting \( P(x) \) into the given equation:
     \[ P(Q(x)) = c(Q(x) - z_1)^{a_1} (Q(x) - z_2)^{a_2} \cdots (Q(x) - z_k)^{a_k} \]
     \[ P(x)^{2017} = c^{2017} (x - z_1)^{2017a_1} (x - z_2)^{2017a_2} \cdots (x - z_k)^{2017a_k} \]
   - Equating the two expressions, we get:
     \[ c(Q(x) - z_1)^{a_1} (Q(x) - z_2)^{a_2} \cdots (Q(x) - z_k)^{a_k} = c^{2017} (x - z_1)^{2017a_1} (x - z_2)^{2017a_2} \cdots (x - z_k)^{2017a_k} \]

4. **Root Analysis**:
   - For the equality to hold, \( Q(x) \) must map each root \( z_i \) to itself or another root \( z_j \) such that the multiplicities match.
   - This implies \( Q(z_i) = z_i \) for all \( i \), otherwise, the multiplicities would not match.

5. **Form of \( Q(x) \)**:
   - Since \( Q(x) \) must map each root \( z_i \) to itself, and \( \deg(Q(x)) = 2017 \), the simplest form for \( Q(x) \) that satisfies this is:
     \[ Q(x) = (x - r)^{2017} + r \]
     where \( r \) is a real number.

6. **Conclusion**:
   - Given the form of \( Q(x) \), \( P(x) \) must be of the form:
     \[ P(x) = (x - r)^n \]
     where \( n \) is a positive integer.

Thus, the polynomials \( P(x) \) and \( Q(x) \) that satisfy the given functional equation are:
\[ P(x) = (x - r)^n \]
\[ Q(x) = (x - r)^{2017} + r \]
where \( r \) is a real number and \( n \) is a positive integer.

The final answer is \( \boxed{ P(x) = (x - r)^n } \) and \( Q(x) = (x - r)^{2017} + r \).