I read this question, but I want to prove that if $f$ is analytic on a connected open set $U$ (not just $f$ entire) with the property that for all $z\in U$ there is natural number $n$ (depending on $z$) such that $f^{(n)}(z)=0 $, then $f$ is a polynomial. The argument should be almost identical but I need to make sure the proof is still sound.
Let $$S_n = \{z: f^{(n)}(z)=0 \}$$
Then if some $S_n$ is uncountable, we should have that $f$ is a polynomial, since $S_n$ has an accumulation point that lies in $U$ So $f^{(n)}$ has a non-isolated zero. Then by the identity theorem $f^{(n)}(z):=0$ on $U$ and $f$ is a polynomial with degree less than $n$. The existence of an uncountable $S_n$ follows from $U=\cup_{n\in \mathbb{N}} S_n$.
I am a bit unsure about the bolded text. I know by Bolzano Weierstrass that there is an accumulation point, but how can I ensure it is in $U$? It seems like it should be true but I should prove it. Otherwise, is the proof complete?
Everything is correct. So, why his the statement in the bolded text true? For each $m\in\mathbb N$, let $U_m=\left\{z\in U\,\middle|\,d(z,\mathbb{C}\setminus U)\geqslant\frac1m\right\}$. Then $\bigcup_{n\in\mathbb N}U_n=U$. Since this is a countable set of sets and since $S_n$ is uncountable, then at least one of the $U_m$'s contains an uncountable subset of $S_n$. Since this is infinite, it has an accumulation point $w$ and it follows from the definition of $U_m$ that $d(w,\mathbb{C}\setminus U)\geqslant\frac1m$. Therefore, $w\in U$.