Assuming the problem is not vacuous (obviously, one can take a domain $U$ s.t $U^2 \cap U= \emptyset$ and any analytic $f$ on $U$ and declare the condition satisfied trivially because there is no $z^2 \in U$ when $z \in U$) the answer is no.
Assume by contradiction such an $f$ exists on a domain $U$ exterior to the unit disc and that the formula gives the analytic continuation of $f$ to $U^2, U^4,...$ (where $U^2$ open is the image of $U$ under $z \to z^2$, etc) and let $W$ the open set (could be disconnected) that is the union of $U, U^2..$ so $f$ is analytic on $W$
The fundamental fact we will use is that if $z, -z \in W$ then $f(z)-f(-z)=2z$ hence $|f(z)| +|f(-z)| \ge 2|z|$
Now, picking $a \in U$, there is a disc centered at $a$ contained in $U$, which means there is a root of unity $\alpha$ of some order $2^k$ and $r>1$ st $r\alpha \in U$ (pick a ray through the origin passing through the above disc and get a close enough ray with an appropriate angle...). This means that some positive number $R >1$ is in $W$.
But now $W$ is open so there is a small closed disc $\bar V$ centered at $R$ included in $W$ and again picking appropriate rays we find that $Re^{\pi 2^{-N-1}i}$ is in $V$ for all high enough $N$ (or notice that $Re^{\pi 2^{-N-1}i} \to R, N \to \infty)$.
Since $f$ is continuous on $\bar V$, $|f|$ attains a maximum $M$ there.
Now $-R^{2^{N+1}}$ is in $W$, so $f(R^{2^{N+1}})-f(-R^{2^{N+1}})=2R^{2^{N+1}}$
$f(R)=R+R^2+...R^{2^n}+f(R^{2^{n+1}})$ for any $n \ge 0$, hence $|f(R^{2^{N+1}})| \le (N+2)R^{2^{N}}+M$ and similarly for $|f(-R^{2^{N+1}})|$, which gives $2R^{2^{N+1}}\le (2N+4)R^{2^{N}}+2M$ and that is impossible for high enough $N$. Done!