I was told by a fellow student that sometimes one cannot represent certain functions by a taylor series. I was also told that sometimes using a taylor series in a proof is invalid. Is any of this true? When is it invalid to use taylor series expansion?
Edit: By certain functions, I mean well behaved functions with nice properties, entire, countinuous, etc.
Take a look at $$f(x)=\begin{cases}e^{-1/x^2}&x\ne0\\0&x=0\end{cases}$$ and take the Taylor expansion around $x=0$
$$f(x)=f(0)+f'(0)x+\frac{f''(0)}2x^2+\dots$$
Now, you will find out that
$$f(0)=0$$
$$f'(0)=0$$
$$f''(0)=0$$
$$etc.$$
So be applying Taylor's theorem here, one has
$$e^{-1/x^2}=0$$
which is nonsense.
Then, there is a second case. As Ethan Alwaise mentions, any series expansion makes no sense if it doesn't converge. Take, for example, the expansion of $\frac1{1-r}$ at $r=0$. Then consider that expansion for $r=2$. You should get something along the following lines:
$$\frac1{1-2}=1+2+4+8+\dots+2^n+\dots$$
which is also nonsense.