Real-analytic $f(z)=f\left(\sqrt z\right) + f\left(-\sqrt z\right)$?
As pointed out by Zarrax, $$ f(z^2)=f(z)+f(-z)\tag{1} $$ implies $$ \sum_{k=0}^\infty a_kz^{2k}=2\sum_{k=0}^\infty a_{2k}z^{2k}\tag{2} $$ therefore, $$ a_k=2a_{2k}\tag{3} $$ Obviously, $a_0=0$. Given $a_k$ for odd $k$, $(3)$ allows us to compute all $a_k$.
Functions with power series that satisfy $(3)$ are $$ \begin{align} f_n(z) &=-\log(1-z^{2n+1})\\[6pt] &=\sum_{k=1}^\infty\frac{z^{k(2n+1)}}{k}\tag{4} \end{align} $$ and linear combinations of the $f_n$. Note that the $f_n$ satisfy $(1)$. In fact, $$ \begin{align} \sum_{n=0}^\infty\frac{\mu(2n+1)}{2n+1}f_n(z) &=\sum_{n=0}^\infty\sum_{k=1}^\infty\frac{\mu(2n+1)}{2n+1}\frac{z^{k(2n+1)}}{k}\\[9pt] &=\sum_{n=1}^\infty\sum_{\substack{d\mid n\\d\text{ odd}}}\mu(d)\frac{z^n}{n}\\ &=\sum_{n=0}^\infty\frac{z^{2^n}}{2^n}\tag{5} \end{align} $$ where $\mu$ is the Möbius function. The last equation in $(5)$ follows from $$ \sum_{\substack{d\mid n\\d\text{ odd}}}\mu(d) =\left\{\begin{array}{} 1&\text{if $n$ is a power of $2$}\\ 0&\text{otherwise} \end{array}\right.\tag{6} $$ We can use $$ \begin{align} f_n\left(z^{2k+1}\right) &=-\log\left(1-z^{(2k+1)(2n+1)}\right)\\ &=f_{2kn+k+n}(z)\tag{7} \end{align} $$ to write all possible functions satisfying $(1)$ as linear combinations of the $f_n$. That is, use $(5)$ then $(7)$ to get $$ \begin{align} \sum_{k=0}^\infty\sum_{n=0}^\infty a_{2k+1}\frac{z^{(2k+1)2^n}}{2^n} &=\sum_{k=0}^\infty\sum_{n=0}^\infty a_{2k+1}\frac{\mu(2n+1)}{2n+1}f_n\left(z^{2k+1}\right)\\ &=\sum_{k=0}^\infty\sum_{n=0}^\infty a_{2k+1}\frac{\mu(2n+1)}{2n+1}f_{2kn+k+n}(z)\tag{8} \end{align} $$ Therefore, all $f$ that satisfy $(1)$ are given by linear combinations of the $f_n$.
For example, we can write the example given by mjqxxxx as $$ \log(1+z+z^2)=f_0(z)-f_1(z) $$
The simplest example of such a function that is real-analytic over the entire real line is $$ f(z)=\log\left(1+z+z^2\right). $$ We have $$ f(\sqrt{z})+f(-\sqrt{z})=\log\left(1+\sqrt{z}+z\right)+\log\left(1-\sqrt{z}+z\right)\\=\log\left((1+z)^2-z\right)\\=\log\left(1+z+z^2\right)\\=f(z), $$ as desired. It's not entire, but is analytic in the neighborhood of the real line, since its branch cuts start at $z=-1/2\pm i\sqrt{3}/2$.