Let $f(x_1,x_2,\dotsc,x_n)$ be a homogeneous polynomial. Let $$S=\{f(a_1,a_2,\dotsc,a_n)\mid a_1,a_2,\dotsc,a_n \in\Bbb Z\}.$$ If $S$ satisfies the following condition: for all $m,n\in S$, we have $mn\in S$. Can we determine all the homogeneous polynomials $f$?
For example, $x^m$, $x^2+n y^2(n\in\Bbb Z)$, $x^2+xy+y^2$, $x^3+y^3+z^3-3xyz$, $x^2+y^2+z^2+w^2$ are all appropriate examples.