Let $f$ be a entire function and $P$ be a polynomial of degree at least $2$.
If $$f(z)=f(P(z)),\quad \forall z\in\mathbb C,$$ Is the entire function $f$ constant function?
My thought: If $f$ is not constant, then $f$ must be transcendental entire function. If the sequence $\{z_n=P^n(z)\}$ iterated by $P$ has a limit point $w_0$ in $\mathbb C$, then $$f(z)=f(z_1)=\cdots=f(z_n)=\cdots,\quad \lim_{n\to\infty}f(z_n)=f(w_0),$$ then $f(z)\equiv w_0$ by Identity theorem. But this is not always ture. For enample, if $P(z)=z^2+1$, take $z=1$, then $z_n\to\infty$.
Also if $$f(z)=f(e^z),\quad \forall z\in\mathbb C,$$ can we have $f$ is constant function?
Any hints and help will welcome.