TITLE: A deceiving Taylor series 
QUESTION [6 upvotes]: When we try to expand
$$
\begin{align}
f:&\mathbb R \to \mathbb R\\
&x \mapsto
  \begin{cases}
  \mathrm e^{-\large\frac 1{x^2}} &\Leftarrow x\neq 0\\
  0 &\Leftarrow x=0
  \end{cases}
\end{align}$$
in the Taylor series about $x = 0$, we wrongly conclude that $f(x) \equiv 0$, because the derivative of $f(x)$ of any order at this point is $0$. Therefore, $f(x)$ is not well-behaved for this procedure.
What conditions determine the good behavior of a function for the Taylor series expansion?

REPLY [2 votes]: To add to the other answers, in many cases one uses some simple sufficient (but not necessary) condition  for analyticity: for example, any elementary function (polynomials, trigonometric functions, exponential,logarithms) is analytic in any open subset of its domain,; the same for compositions, sums, products, reciprocals (except for the points where the original function is zero... which leaves out your example), etc.