Let $f:\mathbb R\longrightarrow \mathbb R$ a function that is $\mathcal C^\infty(\mathbb R) $. Suppose $$\sum_{k=0}^\infty \frac{f^{(k)}(0)}{k!}\,x^k$$ converge and its radius is $R$. Why $$f(x)=\sum_{k=0}^\infty \frac{f^{(k)}(0)}{k!}\,x^k$$ for all $x\in ]-R,R[$ ?
I know that for a fixed $n$, $$f(x)=\sum_{k=0}^n\frac{f^{(k)}(0)}{k!}\,x^k+o(x^n),$$ in a neighborhood of $0$, but a priori it won't be correct for $x$ too large (take for example the sinus or exponential, we have $$e^x=\sum_{k=0}^\infty \frac{x^k}{k!},$$ for all $x\in \mathbb R$, not only in a neighborhood of $O$. So why can we extend the formula to all $x\in\mathbb R$ ?
Ok, let forget $e^{-1/x^2}$. Consider for example $\sin(x)$. Why $$\sin(x)=\sum_{k=0}^\infty \frac{(-1)^{n+1}}{(2n)!}x^{2n},$$ for all $x\in\mathbb R$ whereas $$\sin(x)=\sum_{k=0}^n \frac{(-1)^{n+1}x^{2k}}{(2k)!}+o(x^{2n})$$ in a neighborhood of $0$ only.
This is false. For example, if $f(x)=\exp(-1/x^2)$ for $x\neq 0$ and $f(0)=0$, then $f$ is $C^\infty$ with $f^{(k)}(0)=0$ for all $k$. In particular, $$\sum_{k=0}^\infty \frac{f^{(k)}(0)}{k!}\,x^k$$ converges for all $x$ since every term is $0$. However, it is not true that $$f(x)=\sum_{k=0}^\infty \frac{f^{(k)}(0)}{k!}\,x^k$$ for any $x$ besides $x=0$.
(It happens to be true for certain functions like $f(x)=e^x$, but you must prove it using particular properties of those functions. How you prove it in the case $f(x)=e^x$ depends on what your definition of $e^x$ is; often $e^x$ is simply defined to be $\sum\frac{1}{k!}x^k$ so it is true by definition.)