Let $f:[a,b] \to \mathbb R$ be a continuous function having derivatives of all order such that for every $x \in [a,b] , \exists n_x\in \mathbb Z^+$ such that $f^{(n_x) }(x)=0$ ; then how do I show that $f$ is a polynomial in $[a,b]$ ?
My try : For every $n \in \mathbb Z^+$ define $E_n:=\{x\in[a,b]:f^{(n)}(x)=0\}$ , so each $E_n$ is closed and by given condition , $[a,b]=\cup_{n=1}^\infty E_n$ , since $[a,b]$ is compact it is complete and also it is not hollow ( has non-empty interior) , so by Baire's category theorem , at least one of $E_n$ has non-empty interior , so for some $k\in \mathbb Z^+$ , $E_k$ contains an open ball $B(y,r)$ where $y \in [a,b]$ and then $f^{(k)}(x)=0 , \forall x \in B(y,r) $ and then I am stuck , please help .
I would also like to ask ; Can the proposition be proved without Baire's theorem ?