Find all polynomials \(P(x)\) with real coefficients such that for all nonzero real numbers \(x\), \[P(x)+P\left(\frac1x\right)     =\frac{P\left(x+\frac1x\right) +P\left(x-\frac1x\right)}2.\]

[i]Proposed by Holden Mui[/i]
1. Given the functional equation for the polynomial \(P(x)\):
   \[
   P(x) + P\left(\frac{1}{x}\right) = \frac{P\left(x + \frac{1}{x}\right) + P\left(x - \frac{1}{x}\right)}{2}
   \]
   we start by replacing \(x\) with \(\frac{1}{x}\):
   \[
   P\left(\frac{1}{x}\right) + P(x) = \frac{P\left(\frac{1}{x} + x\right) + P\left(\frac{1}{x} - x\right)}{2}
   \]
   This is the same as the original equation, indicating symmetry.

2. Next, we observe that:
   \[
   P\left(x - \frac{1}{x}\right) = P\left(\frac{1}{x} - x\right)
   \]
   Since \(z = x - \frac{1}{x}\) can take all real values for \(x \in \mathbb{R}\), we conclude:
   \[
   P(z) = P(-z) \quad \forall z \in \mathbb{R}
   \]
   This implies that \(P(x)\) is an even function, and thus can be written as:
   \[
   P(x) = Q(x^2)
   \]
   for some polynomial \(Q(x)\) with real coefficients.

3. Let us assume \(\deg(P(x)) = 2n\), where \(n \in \mathbb{Z}^{+}\). We claim that \(n \leq 2\).

4. Assume for contradiction that \(n > 2\). Let:
   \[
   P(x) = a_{2n}x^{2n} + a_{2n-2}x^{2n-2} + a_{2n-4}x^{2n-4} + \cdots + a_0
   \]
   where \(a_{2i} \in \mathbb{R}\) and \(a_{2n} \neq 0\).

5. Compare the degrees of \(x^{2n-4}\) in the original equation:
   \[
   2a_{2n-4} = 2 \left( \binom{2n-2}{2n} a_{2n} + \binom{2n-3}{2n-2} a_{2n-2} + \binom{2n-4}{2n-4} a_{2n-4} \right)
   \]
   Simplifying, we get:
   \[
   2a_{2n-4} = 2 \left( 0 + 0 + a_{2n-4} \right) \implies a_{2n-4} = 0
   \]

6. Compare the degrees of \(x^{2n-2}\) in the given relation:
   \[
   2n(2n-1)a_{2n} + (2n-2)a_{2n-2} = 0
   \]
   Since \(a_{2n-2} = 0\), we get:
   \[
   2n(2n-1)a_{2n} = 0 \implies a_{2n} = 0
   \]
   This is a contradiction since \(a_{2n} \neq 0\). Hence, \(n \leq 2\).

7. Therefore, the degree of \(P(x)\) is at most 4. Let:
   \[
   P(x) = ax^4 + bx^2 + c
   \]
   Plugging this into the original equation, we get:
   \[
   ax^4 + bx^2 + c + a\left(\frac{1}{x}\right)^4 + b\left(\frac{1}{x}\right)^2 + c = \frac{P\left(x + \frac{1}{x}\right) + P\left(x - \frac{1}{x}\right)}{2}
   \]
   Simplifying, we find:
   \[
   c = 6a
   \]
   Thus, the polynomial \(P(x)\) that satisfies the given relation is:
   \[
   P(x) = ax^4 + bx^2 + 6a
   \]

The final answer is \(\boxed{ax^4 + bx^2 + 6a}\).