Clearly, $x\neq 0$ for the functional equation to even make sense. Let $P(x)=\frac{f(x)}{x^{n/2}}$. Now,
$$x^{n/2}f(1/x)=\frac{f(x)}{x^{n/2}}$$
$$P(1/x)=P(x)$$
Thus $P(1/x)=P(x)$ is necessary. Plugging in $f(x)=x^{n/2}$ to the functional equation, this condition is also sufficient.
We now have our answer: all functions $P$ for which $P(x)=P(1/x)$ will yield a valid function $f$ under $f(x)=x^{n/2}P(x)$, as this maintains a necessary and sufficient condition. Notice that since $f$ is not specified to be continuous, $P$ could even be a point wise function satisfying the condition. There isn't much restriction.
In the results you provided, the first has $P(x)=a$ and the second has $P(x)=b\sum_{i=-n/2}^{n/2}x^i$, both of which satisfy the given condition.