I have the following simple question: Suppose $f$ holomorphic from a connected open set $U \subseteq \mathbb{C}$ to $\mathbb{C}$ and that $f^{(N)} = 0$ on $U$ for some $N\in \mathbb{N}$. Show $f$ is a polynomial.
I understand that this could be done by an application of Taylor's theorem: For any $z\in U$, let $z\in B_r(a)$ for some $a\in U, r>0$. Then by Taylor's theorem, \begin{equation} f(z) = \sum_{n=0}^\infty \frac{f^{(n)}(a)}{n!} (z - a)^n = \sum_{n=0}^N \frac{f^{(n)}(a)}{n!} (z - a)^n, \end{equation} which is a polynomial. But this representation of $f$ depends on $z$ since different $z$ may result in different $a$ although $N$ is not affected. I wonder how to conclude that $f$ is a polynomial on $U$ from here. Thanks a lot.
NOTE: This question is not a duplicate of Entire function with vanishing derivatives?. The answers in that question concluded directly $f$ is a polynomial from $f^{(N)} = 0$ on $U$ by Taylor's theorem. My question is exactly why this is true. Sorry if I'm missing something obvious here.
Please see José Carlos Santos' comments below for an answer. Many thanks to José!