P(x) and Q(x) are polynomials of positive degree such that for all x P(P(x))=Q(Q(x)) and P(P(P(x)))=Q(Q(Q(x))). Does this necessarily mean that P(x)=Q(x)?
Given that \( P(x) \) and \( Q(x) \) are polynomials of positive degree such that for all \( x \), \( P(P(x)) = Q(Q(x)) \) and \( P(P(P(x))) = Q(Q(Q(x))) \), we need to determine if this necessarily implies that \( P(x) = Q(x) \).

1. **Leading Coefficients:**
   From \( P(P(P(x))) = Q(Q(Q(x))) \), we can infer that \( P \) and \( Q \) must have the same leading coefficient. This is because the leading term of a polynomial dominates its behavior for large \( x \), and if the leading coefficients were different, the compositions \( P(P(x)) \) and \( Q(Q(x)) \) would not match for large \( x \).

2. **Assume \( P(x) \neq Q(x) \):**
   Suppose \( P(x) \neq Q(x) \). Let:
   \[
   P(x) = a_n x^n + a_{n-1} x^{n-1} + \cdots + a_0
   \]
   \[
   Q(x) = b_n x^n + b_{n-1} x^{n-1} + \cdots + b_0
   \]
   Since \( P \) and \( Q \) have the same leading coefficient, \( a_n = b_n \).

3. **Behavior for Large \( x \):**
   Consider the behavior of \( P(x) \) and \( Q(x) \) for large \( x \). Since \( P \) and \( Q \) are polynomials of the same degree with the same leading coefficient, their leading terms will dominate. However, the lower-order terms will cause a difference in their values unless all corresponding coefficients are equal.

4. **Contradiction:**
   If \( P(x) \neq Q(x) \), there must be some \( k \) such that \( a_k \neq b_k \). Without loss of generality, assume \( a_k > b_k \). For sufficiently large \( x \), \( P(x) > Q(x) \). This implies:
   \[
   P(P(x)) > Q(P(x)) \quad \text{and} \quad P(P(x)) > Q(Q(x))
   \]
   However, this contradicts the given condition \( P(P(x)) = Q(Q(x)) \).

5. **Conclusion:**
   Since assuming \( P(x) \neq Q(x) \) leads to a contradiction, we must have \( P(x) = Q(x) \).

\(\blacksquare\)

The final answer is \( \boxed{ P(x) = Q(x) } \).