Let $p(x)\in\mathbb{C}[x]$ be a polynomial that satisfies the functional equation
$$p(x)\,p(-x)=p(x^2)\,.\tag{*}$$
Clearly, $p\equiv 0$ and $p\equiv 1$ are the only constant solutions. Let now assume that $p$ is nonconstant. Hence, the set $Z(p)$ of the roots of $p$ is nonempty.
Suppose that $z\in Z(p)$. Then, $z^2\in Z(p)$ by (*). Hence, we have an infinite sequence $z,z^2,z^{2^2},z^{2^3},\ldots$ of elements of $Z$. However, $Z$ must be a finite set. Therefore, $$z^{2^k}=z^{2^l}$$ for some integers $k$ and $l$ such that $k>l\geq 0$. This means either $z=0$, or $z$ is a primitive root of unity of an odd order.
It is easy to show that, if $m$ is a nonnegative integer such that $x^m$ divides $p(x)$ but $x^{m+1}$ does not, then
$$p(x)=(-x)^m\,q(x)\,,$$
where $q(x)\in\mathbb{C}[x]$ also satisfies (*). If $n$ is a nonnegative integer such that $(x-1)^n$ divides $q(x)$ but $(x-1)^{n+1}$ does not, then
$$q(x)=(1-x)^n\,r(x)$$
where $q(x)\in\mathbb{C}[x]$ also satisfies (*). We now have a polynomial $r$ satisfying (*) such that $\{0,1\}\cap Z(r)=\emptyset$. If $r$ is constant, then $r\equiv 1$, making
$$p(x)=(-x)^m\,(1-x)^n\,.$$
Suppose now that $r$ is nonconstant, so $Z(r)\neq\emptyset$. For each $z\in Z(r)$, let $\theta(z)\in\mathbb{R}/2\pi\mathbb{Z}$ be the angle (modulo $2\pi$) such that $z=\exp\big(\text{i}\,\theta(z)\big)$. Define $\Theta(r)$ to be the set of $\theta(z)$ with $z\in Z(r)$. Note that each element of $\Theta(r)$ is equal to $\dfrac{2p\pi}{q}$ (modulo $2\pi$), where $p$ and $q$ are coprime positive integers such that $p<q$ and $q$ is odd. Furthermore, $\Theta(r)$ is closed under multiplication by $2$. Therefore, the set $\Theta(r)$ can uniquely be partitioned into subsets of the form
$$C(\alpha):=\{\alpha,2\alpha,2^2\alpha,2^3\alpha,\ldots\}\,,$$
where $\alpha\in\mathbb{R}/2\pi\mathbb{Z}$. Such a subset of $\Theta(r)$ is called a component.
Here are some examples of components.
If $\alpha=\dfrac{2\pi}{3}$, then $C(\alpha)=\left\{\dfrac{2\pi}{3},\dfrac{4\pi}{3}\right\}$ modulo $2\pi$.
If $\alpha=\dfrac{2\pi}{5}$, then $C(\alpha)=\left\{\dfrac{2\pi}{5},\dfrac{4\pi}{5},\dfrac{6\pi}{5},\dfrac{8\pi}{5}\right\}$ modulo $2\pi$.
If $\alpha=\dfrac{2\pi}{7}$, then $C(\alpha)=\left\{\dfrac{2\pi}{7},\dfrac{4\pi}{7},\dfrac{8\pi}{7}\right\}$ modulo $2\pi$.
If $\alpha=\dfrac{6\pi}{7}$, then $C(\alpha)=\left\{\dfrac{6\pi}{7},\dfrac{10\pi}{7},\dfrac{12\pi}{7}\right\}$ modulo $2\pi$.
For each component $C(\alpha)\subseteq\Theta(r)$, let $$\mu_\alpha(x):=\prod_{\beta\in C(\alpha)}\,\Big(\exp\big(\text{i}\,\beta\big)-x\Big)\,.$$ Observe that $\mu_\alpha$ is a cyclotomic polynomial if and only if $2$ is a generator of the multiplicative group $(\mathbb{Z}/q\mathbb{Z})^\times$, where $\alpha=\dfrac{2p\pi}{q}$ (modulo $2\pi$) for some positive integers $p$ and $q$ with $\gcd(p,q)=1$.
Show that there exist positive integers $\nu_\alpha$ for each component $C(\alpha)$ of $r(x)$ such that
$$r(x)=\prod_{C(\alpha)\subseteq \Theta(r)}\,\big(\mu_\alpha(x)\big)^{\nu_\alpha}\,.$$
For convenience, we let $\Theta(p):=\Theta(r)$.
Therefore,
$$p(x)=(-x)^m\,(1-x)^n\,\prod_{C(\alpha)\subseteq\Theta(p)}\,\big(\mu_\alpha(x)\big)^{\nu_\alpha}\,.$$
Any polynomial $p(x)$ in the form above is always a solution to (*).