Find all the possible values of a positive integer $n$ for which the expression $S_n=x^n+y^n+z^n$ is constant for all real $x,y,z$ with $xyz=1$ and $x+y+z=0$.
1. **Given Conditions**: We are given that \( x, y, z \) are real numbers such that \( x + y + z = 0 \) and \( xyz = 1 \). We need to find all positive integers \( n \) for which \( S_n = x^n + y^n + z^n \) is constant for all such \( x, y, z \).

2. **Verification for \( n = 1 \)**:
   \[
   S_1 = x + y + z = 0
   \]
   Since \( x + y + z = 0 \) by the given condition, \( S_1 \) is indeed constant and equal to 0 for all such \( x, y, z \).

3. **Verification for \( n = 3 \)**:
   Using the identity for the sum of cubes:
   \[
   x^3 + y^3 + z^3 - 3xyz = (x + y + z)(x^2 + y^2 + z^2 - xy - xz - yz)
   \]
   Given \( x + y + z = 0 \), the identity simplifies to:
   \[
   x^3 + y^3 + z^3 - 3xyz = 0
   \]
   Therefore:
   \[
   x^3 + y^3 + z^3 = 3xyz
   \]
   Given \( xyz = 1 \), we have:
   \[
   x^3 + y^3 + z^3 = 3
   \]
   Thus, \( S_3 = 3 \) is constant for all such \( x, y, z \).

4. **Verification for \( n = 2 \)**:
   Consider the two triples \( (-2^{-\frac{1}{3}}, -2^{-\frac{1}{3}}, 4^{\frac{1}{3}}) \) and \( (-6^{-\frac{1}{3}}, -2 \cdot 6^{-\frac{1}{3}}, \frac{1}{2} \cdot 36^{\frac{1}{3}}) \). Both satisfy \( x + y + z = 0 \) and \( xyz = 1 \).

   For \( n = 2 \):
   \[
   S_2 = x^2 + y^2 + z^2
   \]
   For the first triple:
   \[
   S_2 = (-2^{-\frac{1}{3}})^2 + (-2^{-\frac{1}{3}})^2 + (4^{\frac{1}{3}})^2 = 2 \cdot 2^{-\frac{2}{3}} + 4^{\frac{2}{3}}
   \]
   For the second triple:
   \[
   S_2 = (-6^{-\frac{1}{3}})^2 + (-2 \cdot 6^{-\frac{1}{3}})^2 + \left(\frac{1}{2} \cdot 36^{\frac{1}{3}}\right)^2 = 6^{-\frac{2}{3}} + 4 \cdot 6^{-\frac{2}{3}} + \frac{1}{4} \cdot 36^{\frac{2}{3}}
   \]
   After computation, it can be shown that these values are not equal, hence \( S_2 \) is not constant.

5. **Verification for \( n > 3 \)**:
   For \( n > 3 \), similar computations show that \( S_n \) for the second triple is greater than \( S_n \) for the first triple, indicating that \( S_n \) is not constant.

Conclusion:
The only values of \( n \) for which \( S_n \) is constant for all real \( x, y, z \) with \( x + y + z = 0 \) and \( xyz = 1 \) are \( n = 1 \) and \( n = 3 \).

The final answer is \( \boxed{ n = 1 } \) and \( n = 3 \).