solving a problem on functions

If you write g(x) = f(x) - 1, then the equation becomes

g(x)g(1/x) = 1.

The rational function g(1/x) can be written with a denominator of the form x\^n, but it is also 1/g(x). Hence g(x)|x\^n, and g(x) must itself be a monomial.

Substituting g(x) = ax\^m into the equation, we find a = 1, -1, so f(x) = 1 +/- x\^m.
by
If the relation is true for all x, since f is a polynomial, f(x) = ∑(a_i * x^(i)). Then f(1/x) = ∑(a_i * x^(-i)) is rational. One polynomial that satisfies the equality is f(x) = x^n + 1.  Thus 2^n + 1 = 9 means n = 3. f(3) = 3^3 + 1 = 28.
Maybe I'm missing something but I wasn't able to show that f(3)=28 without first classifying all polynomial solutions to the functional equation.

First the only non-constant solutions to the function equation are f(x)=0 and f(x)=2 which do not satisfy the condition that f(2)=9.

If you assume f(x) is a non-constant polynomial of degree d > 0 and plug a(0) + a(1)x + ... + a(d)x^(d) into the functional equation then you can determine that a(0)=1, a(d)=1 or -1, and that all other coefficients are 0.   In other words, f(x) = 1+x^(k) or 1-x^(k) for k=0,1,2,...

Since f(2)=9, f(x)=1+x^(3) and f(3)=28.
by