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$.
Problem
Source: 2018 Belarusian National Olympiad 11.1
Tags: parameterization, algebra, functional equation