Finding every possible $f(x), a\in\mathbb R$ such that ${\{f(x)\}}^2=a+f(x^2)$ Let $f(x)$ be a rational expression of $x$, and let $a$ be a real number. Then, I'm facing difficulty for finding every possible $a, f(x)$ such that 
$${\{f(x)\}}^2=a+f(x^2).$$
Here, suppose that $f(x)$ is not a constant, and that a rational expression can be represented as $\frac{h(x)}{g(x)}$ where each of $g(x), h(x)$ is a polynomial of $x$.
I've already found that 
$$a=0, \ f(x)=x^n\ (n\not=0\in\mathbb Z),$$
$$a=2, \ f(x)=x^n+\frac{1}{x^n}\ (n\in\mathbb N)$$
satisfy the condition, but I can neither find any other pairs nor prove that these are the only solutions. Can anyone help?
 A: To get you started: If $f$ has a pole of order $n$ at $x=0$, with $f(x) = c_{-n} x^{-n} + \ldots$ near $x=0$, then $f(x)^2 = c_{-n}^2 x^{-2n} + \ldots$ and
$f(x^2) = c_{-n} x^{-2n} + \ldots$ so $c_{-n} = 1$.  Now what about the next coefficient (if any)?  What about poles elsewhere (including $\infty$)? 
A: Let $f(x)=\frac{h(x)}{g(x)}$ where $h(x),g(x)$ are polynomials of $x$ such that they do not have the common factor whose degree is more than $1$ or equal to $1$. We can say that $f(x)$ is irreducible. Also, we may suppose that the leading coefficient of $g(x)$ is $1$. Then, $f(x^2)=\frac{h(x^2)}{g(x^2)}$ is also irreducible. This is because if $h(x^2), g(x^2)$ have the common factor $p(x)$, then $h({\alpha}^2)=g({\alpha}^2)$ holds supposing that a solution of $p(x)=0$ is $x=\alpha$. This leads that $h(x),g(x)$ have the common factor $x-{\alpha}^2$, which is a contradiction. Then, by the given condition ${f(x)}^2-a=f(x^2)$, we get
$$\begin{align}\frac{{h(x)}^2-a{g(x)}^2}{{g(x)}^2}=\frac{h(x^2)}{g(x^2)}\qquad(1)\end{align}$$
Since the both side of $(1)$ are irreducible rational expression, we know that $$\begin{align}{g(x)}^2=g(x^2)\qquad(2)\end{align}$$
Since $g(x)\not=0$, letting $cx^n(c\not=0)$ be the term of the minimum degree which is not $0$, we can write
$$g(x)=cx^n+dx^m+\cdots.$$
In the following, we'll write in ascending order of powers unless otherwise noted. Then, substituting this for $(2)$, we get
$${g(x)}^2=c^2x^{2n}+2cdx^{n+m}+d^2x^{2m}+\cdots,$$
$$g(x^2)=cx^{2n}+dx^{2m}+\cdots.$$
Since these are equal, $c^2=c, 2cd=0$ lead $c=1,d=0$. Hence we get 
$$\begin{align}g(x)=x^n\ (n\ge0)\qquad(3)\end{align}$$
Then, substituting $(3)$ for the given condition, we get
$$\begin{align}\frac{{h(x)}^2}{x^{2n}}-a=\frac{h(x^2)}{x^{2n}}\qquad(4)\end{align}$$
$(A)$ Supposing that $a=0$, $(4)$ leads ${h(x)}^2=h(x^2)$. Hence, by the same argument above, since $h(x)=x^m\ (m\ge0)$, we get $f(x)=\frac{x^m}{x^n}=x^{m-n}$. The fact that $f(x),g(x)$ are irreducible and that $f(x)$ is not a constant lead $f(x)=x^k\ (k\not=0\in\mathbb Z).$
$(B)$ Suppose that $a\not=0$. We can get the following fact.
FACT $1$ : $h(x)$ is not a constant.
By the fact $1$, we can write $h(x)=d+ex^n+k(x)\ (e\not=0,m\gt0)$. Then, by $(4)$, we get
$$\begin{align}{h(x)}^2-ax^{2n}=d^2+e^2x^{2m}+{k(x)}^2+2dex^m+2ex^m+2ex^mk(x)+2dk(x)-ax^{2n}\qquad(5)\end{align}$$
$$\begin{align}h(x^2)=d+ex^{2m}+k(x^2)\qquad(6)\end{align}$$
Since $d^2=d$, we get $d=1$. Also, we get $2n=m, 2e=a$. In the following, let us prove that $k(x)=0.$ We can get the following fact.
FACT $2$ : The power of each term of $k(x)$ can be divided by $m$.
By the fact $2$, we can write
$$k(x)=e_px^{pm}+e_{p-1}x^{(p-1)m}+\cdots+e_2x^{2m}\ (e_p\not=0).$$
Moreover, we can get the following fact.
FACT $3$ : The power of each term of $k(x)$ is either (even)$\times m$ (let us call this $E$-type) or (odd)$\times m$ (let us call this $O$-type).
Then, the power of each term except for both $2ex^mk(x)$ and $2dk(x)$ is (even)$\times m$. If $k(x)$ is $O$-type, then only each term of $2dk(x)$ is the term with (odd)$\times m$-th degree. If $k(x)$ is $E$-type, then only each term of $2ex^mk(x)$ is the term with (odd)$\times m$-th degree. In any case, we get $k(x)=0$.
Hence, since we get $h(x)=1+ex^m, 2e=a$, $(e^2-e)x^{2m}=0$ leads $e=1$. As a result, since $h(x)=1+x^{2n}$, we get
$$f(x)=\frac{1+x^{2n}}{x^n}=\frac{1}{x^n}+x^n\ (n\gt 0).$$
We now know that the proof is completed.
