If $f(x)$ is a polynomial with rational coefficients such that for every rational number $r$, $f(r)$ is the square of a rational number, can we conclude that $f(x) = g(x)^2$ for some other polynomial $g(x)$ with rational coefficients?
I proved the quadratic case in my answer to this question, and am guessing that the general case is true, but don't know how to proceed.
Does this extend to polynomials in several variables? What about in different fields of fractions? Note: this is not true for complex numbers, since every complex value is the square of a complex number, but linear polynomials are not perfect squares
It seems like the proper formulation of this question is that if $f(x_1, x_2, \ldots x_n)$ is a polynomial with integer coefficients such that every integer specialization of $x_1, x_2, \ldots, x_n$ is a perfect $p$th power, then $f$ is a perfect $p$th power polynomial.
A proof is available here, which further shows that it only needs to hold for some $|x_i| < C$ (though it's a humongous $C$). Theorem 4 answers the question above and is similar to that presented by Franklin. The multi-variable case is dealt with via induction.