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.