When I teach second-semester calculus I usually discuss the function $f$ defined by $ f(x)=e^{-1/x^2} $ for $x \neq 0$ and $f(0)=0$. Or, almost the same example, $g$ defined by $ g(x)=e^{-1/x^2} $ for $x>0$ and $g(x)=0$ for $x \in (-\infty,0]$. Both $f$ and $g$ are too smooth at $x=0$ to be analytic on a neighboorhood of the origin. Each has trivial Taylor series at $x=0$ and yet each function is clearly nonzero in any open nbhd which contains zero. So far as I'm aware, these are the standard examples to clarify the distinction between smooth and analytic functions on $\mathbb{R}$
Question: are there other examples of functions which are smooth but non analytic? Is it possible to give a smooth function which fails to be analytic on an interval? How special are the examples I offer?
I realize you can shift my examples vertically, horizontally, rescale or even add an analytic function to make it look different. Ideally I'm looking for a genuinely different looking example then the two I offered; also, given the intended audience, I dream of a formula which is accessible to calculus II students. I hope the spirit of the question is clear.
Thanks in advance for your insights!