Is there a periodic function $f:\mathbb{R}\to\mathbb{R}$ with period $2\pi$ such that $f\in C^\infty$(i.e. $f$ is infinitely differentiable) and $\sum\limits_{i=0}^\infty\frac{f^{(i)}(0)}{i!}$ does not converge?
My idea is that since there is an infinitely differentiable function $g$ such that \begin{align*} g(x)=\begin{cases} 1, & x\in[a,b],\\ 0, & x\in(-\infty,a']\cup[b',\infty), \\ (between\ 0\ and\ 1), & otherwise, \\ \end{cases} \end{align*} Where $a'b$, I can find some $a$,$a'$,$b$,$b'$ and multiply g with $\frac{1}{1-x}$ and extend the product to $\mathbb{R}$. Is such construction legal?