If $f$ is entire, $\forall x \in \mathbb{R} \hspace{2 mm}\exists n \in \mathbb{N}: f^{(n)}(x)=0 $ then $f$ is polynomial. This was a question on a complex analysis exam:
If $f:\mathbb{C} \rightarrow \mathbb{C}$ is entire, and $\forall x \in \mathbb{R} \hspace{2 mm}\exists n \in \mathbb{N}: f^{(n)}(x)=0 $ prove that $f$ is polynomial.
Solution: Let $A_n= \{ x \in \mathbb{R}: f^{(n)}(x)=0\} $. Τhen each $A_n$ is closed and $\bigcup A_n = \mathbb{R} $, so by the Baire category theorem there must be a $k \in \mathbb{N} $ such that $ A_k $ has non-empty interior. That means there is an interval $(a, b) \subseteq A_k $. So $f^{(k)}(x)=0$ for $x \in (a,b)$. Since $f$ is entire so is $f^{(k)}$, therefore $f^{(κ)}\equiv 0$, so $f^{(n)} \equiv 0$ for $ n \ge k$ which means that $f$ a polynomial. 
Is the above proof correct? Is there a way to avoid using Baire theorem?
 A: Assume by contradiction that $f$ is not a polynomial. Then all the $A_n$ are countable (they are discrete), so their union is countable. But this implies that $\mathbb{R}$ is countable.
A: If $f$ is not a polynomial, each $f^{(k)}$ is a nonconstant entire function and has a discrete, and therefore countable, set of zeros.  But $\mathbb R$ is uncountable.
A: Proof without using Baire:
For each $x \in \Bbb{R}$, fix $n_x \in \Bbb{N}$ such that $f^{(n_x)}(x) = 0$.
We have
$$
\Bbb{R} = \bigcup_n \{x \in \Bbb{R} \, \mid \, n_x = n\}.
$$
Hence, there is some $n \in \Bbb{N}$ such that $\{x \in \Bbb{R} \, \mid \, n_x = n\} =: A$ is uncountable. Hence, $A \cap [-k,k]$ is uncountable for some $k \in \Bbb{N}$ and hence has a point of accumulation.
Since $f$ is analytic, so is $f^{(n)}$. Hence $f^{(n)} \equiv 0$, which shows that $f$ is a polynomial.
A: Since $f^{(n)}(x)=0$ for all $x\in\mathbb{R}$, $f(x)=p(x)$ on $\mathbb{R}$, where $p(x)$ is a polynomial. Let $g(z)=f(z)-p(z)$. Note that $\{a_k\}=\{\frac 1n\}\subset\mathbb{R}\subset\mathbb{C}$ satisfied $\lim_{n\to\infty}a_n=0$ and $g(a_n)=0$ for each $n$. Thus $g(z)\equiv0$ for $\forall z\in\mathbb{C}$ since zeros of a nonzero analytical function are isolated. So $f(z)=p(z)$ for $\forall z\in\mathbb{C}$.
