A deceiving Taylor series  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?
 A: The class of $ \mathbb{R} \to \mathbb{R} $ functions you are looking for are those which not only have derivatives of all orders at a point, so that we can associate with it a Taylor series, but for which the value of the Taylor series actually coincides with the values of the function is some neighborhood of the expansion point. The name given to these functions are Real analytic functions. 
The condition to check if a function is real analytic is to investigate the remainder term in its Taylor polynomial expansion. If the remainder term goes to $0$ then the function is real analytic. In the example you give above, all Taylor polynomials of the function are the $0$ function, while the "remainder" is the entire function. You can not be too much more specific than this since the exact nature of the remainder depends crucially on the function being investigated, so you must check it manually for each function. 
A sufficient condition, as Matt and Sivaram have mentioned, is to check that the function's continuation to the complex plane is complex-differentiable in some open neighborhood around the point of interest, since holomoprhicity implies complex analyticity. 
A: You are given a $C^\infty$ function $f$ defined in a neighborhood $U$ of $0\in{\mathbb R}$ and are asking for a criterion guaranteeing
$$f(x)\ =\ \sum_{k=0}^\infty {f^{(k)}(0)\over k!}\ x^k\qquad(|x|<a)\qquad(*)$$
for some $a>0$. Now such a criterion must work with the given data, i.e., the function $f:\ U\to{\mathbb R}$, and nothing else. Here is such a criterion: If there is an $a>0$ and an $n_0$ such that
$$\bigl|f^{(n)}(t)\bigr|\ \leq\ n!\qquad\bigl(|t|\leq a, \ n>n_0\bigr)$$
then $(*)$ holds. Using this criterion, you can, e.g., prove that
$$\log(1+t)=\sum_{k=1}^\infty (-1)^{k-1}\ {t^k\over k}\qquad\bigl(|t|<{1\over2}\bigr)$$
without referring to complex analysis.
For the proof one has to note that one form of Taylor's theorem says that
$$f(x)\ =\ j_0^n(x)+R_n(x)\qquad(|x|<a)\ ,$$
where $j_0^n$ denotes the $n$th Taylor polynomial of $f$ at $0$, and the remainder $R_n(x)$ can be written in the form
$$R_n(x)={f^{(n+1)}(\xi)\over (n+1)!}\ x^{n+1}$$
for some unknown $\xi$ between $0$ and $x$. Using the assumptions on $f$ it is then easy to show that $\lim_{n\to\infty} R_n(x)=0$ for all $|x|<a$.
A: 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. 
