Another way of putting differentiability, opposed to the one you put, is that $\displaystyle f'$ exists at $\displaystyle x_0$ if

$\displaystyle \displaystyle\lim_{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0}$

exists. Now, for

*our* $\displaystyle f$ evidently it is differentiable for $\displaystyle x\ne 0$ and at $\displaystyle x=0$ we see that

$\displaystyle \displaystyle \lim_{x\to0}\frac{f(x)-f(0)}{x-0}=\frac{e^{\frac{-1}{x^2}}-0}{x}=\lim_{x\to0}\frac{1}{x}e^{\frac{-1}{x^2}}=0$

And thus $\displaystyle f'(0)$ exists and equals zero. Thus,

$\displaystyle f'(x)=\begin{cases}\frac{2}{x^3}e^{\frac{-1}{x^2}} & \mbox{if}\quad x\ne0\\ 0 & \mbox{if}\quad x=0\end{cases}$

So, it's clear that $\displaystyle f''$ exists for $\displaystyle x\ne0$ and we see that

$\displaystyle \displaystyle \lim_{x\to0}\frac{f'(x)-f'(0)}{x-0}=\lim_{x\to0}\frac{\frac{2}{x^3}e^{\frac{-1}{x^2}}-0}{x}=\lim_{x\to0}\frac{2}{x^4}e^{\frac{-1}{x^2}}=0$

and thus $\displaystyle f''(0)$ exists and equals zero. So,

$\displaystyle f''(x)=\begin{cases}e^{\frac{1}{x^2}}\left(\frac{4 }{x^6}-\frac{6}{x^4}\right) & \mbox{if}\quad x\ne0\\ 0 & \mbox{if}\quad x=0\end{cases}$

From here we can proceed by induction. Namely, assume that $\displaystyle f^{(n)}(x)$ exists for all $\displaystyle x$. Then, show, by induction that

$\displaystyle f^{(n)}(x)=\begin{cases}p\left(\frac{1}{x}\right)e ^{\frac{-1}{x^2}} & \mbox{if}\quad x\ne 0\\ 0 & \mbox{if}\quad x=0\end{cases}$

And thus showing that $\displaystyle f^{(n+1)}(0)$ exists (since clearly $\displaystyle f$ is $\displaystyle n+1$ times differentiable for $\displaystyle x\ne0$) reduces to showing that

$\displaystyle \displaystyle \lim_{x\to0}\frac{f^{(n)}(x)-f^{(n)}(0)}{x-0}=\lim_{x\to0}\frac{p\left(\frac{1}{x}\right)e^{\ frac{-1}{x^2}}-0}{x}=\lim_{x\to0}\frac{1}{x}p\left(\frac{1}{x}\ri ght)e^{\frac{-1}{x^2}}$

exists and, in fact equals zero. Thus it follows by induction that $\displaystyle f$ has derivatives of all orders.

*Remark:* This shows that being $\displaystyle C^{\infty}$ does not imply real analyticity since this $\displaystyle f$ is infinitely differentiable at $\displaystyle 0$ but for any $\displaystyle I$ around $\displaystyle 0$ we have that $\displaystyle \displaystyle \sum_{n=0}^{\infty}\frac{f^{(n)}(0)x^n}{n!}=\sum_{ n=0}^{\infty}\frac{0x^n}{n!}=0$. Thus, the Taylor series at $\displaystyle 0$ of $\displaystyle f$ does not agree with $\displaystyle f$ on any open interval around $\displaystyle 0$