In this question, Is there an analytic function with $f(z)=f(e^{iz})$?, it was settled that there exists no non-constant analytic function $f$ such that $f=f \circ g$, where $g(z)=e^{iz}$. Below is an alternate attempt to prove it.
$\textbf{Proof}: ~~$Suppose $f'(z_0)\not = 0$ for some $z_0 \in \mathbb{C}$. Then, $f$ is locally injective around $z_0$, which implies $z=e^{iz}$ locally around $z_0$. Clearly this is impossible, since the zero set of $z \to z-e^{iz}$ can atmost be countable.
However, these approach seems to prove the following - Suppose $g$, $h $ are analytic, then for any non-constant analytic $f$, $f \circ g \not= f \circ h $ unless $g=h$.
This is not true. Am I missing something?
It's wrong. It's perfectly possible to have $f\circ g=f\circ h$ with $h\neq g$; take for example $f:z\to z^2$ and $h=-g$, or $f:z\to e^z$ and $h=g+2ik\pi$ with $k\in \mathbb{Z}\setminus\{0\}$.
The problem in your argument is that you consider a point $z_0$ at the neighborhood of which $f$ is injective, but there is no reason to assume that $e^{iz_0}=z_0$...