find f(x) polynomial with rational coefficients such that $f(x)^{2} = g(x)^{2}(x^{2}+1)$ g(x) is a polynomial with rational coefficients that is not 0 . I need to find f(x) polynomial with rational coefficients such that:
$f(x)^{2} = g(x)^{2}(x^{2}+1)$ or prove such polynomial does not exist.
things I did:
$gcd(f^{2}(x), x^{2}+1) = x^{2}+1 $ therefore: $A(x)f^{2}(x)+ B(x)(x^{2}+1) = x^{2}+1 $
and then 
$(x^{2}+1)[A(x)g^{2}(x) + B(x)] =(x^{2}+1) $ now is it possible that the second polynomial will be 1? I think there is no such polynomial I'm stuck. thank for your help
 A: This is essentially the problem whether $\sqrt 2$ is a rational number. The same technique applies:
Let $p(x)=x^2+1$. This is an irreducible polynomial in $\mathbb Q[x]$. Consider $f(x)^{2} = g(x)^{2}p(x)$ and look at the powers of $p$ that divide each side. On the left, you get an even power, but on the right you get an odd power.
A: Have you heard of the fundamental theorem of algebra, which states that every polynomial of degree $n$ has $n$ complex roots, possibly with repetition? Try counting the number of roots of $f$.
A: Consider order of zero at $x=i$ for polynomials $f(x)^2$ and $g(x)^2(x^2+1)=g^2(x)(x-i)(x+i)$. We know that the order of zero at $x=i$ for $h(x)^2$, where $h(x)$ is polynomial is even, so the order of zero at $x=i$ for $f(x)^2$ is even and for $g(x)^2(x-i)(x+i)$ is odd. 
A: There's no such $f$.
Suppose for contradiction there is one.
Then $2\deg(f)=2\deg(g)+2$, that is $\deg(f)=\deg(g)+1$
Write the division of $f$ by $g$ as $$f(x)=g(x)Q(x)+K$$ where $Q=X-\beta$ is a degree $1$ polynomial ($\beta \in \mathbb Q$) and $K\in  \mathbb Q$.
Then $f^2(x)=g^2(x)(x^2+1)=g^2(x)Q^2(x)+2Kg(x)Q(x)+K^2$.
Expanding and simplfying a bit yields $K=0$ and $$g^2(x)(\beta^2-2\beta x-1)=0$$
Thus, the polynomial $2\beta X-1+\beta^2$ is $0$ which implies $\beta=0$ and $\beta^2 -1=0$
Contradiction.
