I am working on exercice 9.5.2 of Analysis by Zorich and I am stuck at the question b.
a) A set $E\subset X$ of a metric space $(X,d)$ is nowhere dense in X if it is not dense in any ball, that is, if for every ball $B(x,r)$ there is a second ball $B(x_1,r_1)\subset B(x,r)$ containing no points of the set $E$. A set E is of first category in X if it can be represented as a countable union of nowhere dense sets. A set that is not of first category is of second category in $X$. Show that a complete metric space is set of second category (in itself).
b) Show that if a function $f\in C^{(\infty)}[a,b]$ is such that $\forall x\in [a,b] \;\exists n\in \mathbb{N} \;\forall m>n \;(f^{(m)}(x)=0)$, then $f$ is a polynomial.
Here's my try: Define the sets $S_n:=\{x\in[a,b]\mid f^{(m)}(x)=0\; \forall m>n\}$. Then $\cup_{n=1}^{\infty} S_n =[a,b]$. As $[a,b]$ is a complete metric space, $S_n$ cannot be all nowhere dense. Define $Y:=\{x\in [a,b] \mid \text{ there exists a neighborhood of } x \text{ and } n \text{ such that } S_n \text{ is dense in that neighborhood}$. I want to say that $Y=[a,b]$ so that I could conclude with the compactness of $[a,b]$. But all I can say is that the complement of $Y$ in $[a,b]$ contains no interval.
Can you help me? Thanks!