Find all real numbers $a$ for which there exists a function $f$ defined on the set of all real numbers which takes as its values all real numbers exactly once and satisfies the equality
$$
f(f(x))=x^2f(x)+ax^2
$$
for all real $x$.
1. **Define the assertion**: Let \( P(x) \) be the assertion \( f(f(x)) = x^2 f(x) + a x^2 \).

2. **Existence of \( u \)**: Since \( f \) is bijective, there exists a real number \( u \) such that \( f(u) = -a \).

3. **Evaluate at \( x = 0 \)**: 
   \[
   P(0) \implies f(f(0)) = 0^2 f(0) + a \cdot 0^2 \implies f(f(0)) = 0
   \]

4. **Evaluate at \( x = u \)**:
   \[
   P(u) \implies f(f(u)) = u^2 f(u) + a u^2 \implies f(-a) = u^2 (-a) + a u^2 \implies f(-a) = 0
   \]

5. **Evaluate at \( x = -a \)**:
   \[
   P(-a) \implies f(f(-a)) = (-a)^2 f(-a) + a (-a)^2 \implies f(0) = a^2 \cdot 0 + a^3 \implies f(0) = a^3
   \]

6. **Relate \( f(0) \) and \( a \)**: From step 5, we have \( f(0) = a^3 \). From step 4, we have \( f(0) = -a \). Therefore:
   \[
   -a = a^3
   \]

7. **Solve the equation**: 
   \[
   a^3 + a = 0 \implies a(a^2 + 1) = 0
   \]
   The solutions to this equation are:
   \[
   a = 0 \quad \text{or} \quad a^2 + 1 = 0
   \]
   Since \( a^2 + 1 = 0 \) has no real solutions, we conclude:
   \[
   a = 0
   \]

8. **Verify the solution**: If \( a = 0 \), the functional equation becomes:
   \[
   f(f(x)) = x^2 f(x)
   \]
   One possible solution is \( f(x) = x |x| \), which satisfies the equation:
   \[
   f(f(x)) = f(x |x|) = (x |x|) |x |x|| = x^2 |x| = x^2 f(x)
   \]
   Thus, \( f(x) = x |x| \) is a valid solution when \( a = 0 \).

Conclusion:
\[
\boxed{a = 0}
\]