Q:

Is there a non-constant function for which the set of zeroes of the derivative has a limit point?

I was working on an unrelated problem and wanted to show that I could find a neighborhood of a point $c$ where $f'(c) = 0$ that does not contain any other zeroes of the derivative. 
Is this true in general? Let $I$ is an interval in $\mathbb{R}$ (possibly equal to $\mathbb{R}$ itself). Suppose $f : I \to R$ is differentiable, and $c \in Int(I)$ be such that $f'(c) = 0$. Can we always find a neighborhood $N(c)$ where $f'$ is never $0$ on $N(c)\setminus \{ 0 \}$?
If this is not true, can we find a function where the set of points $x$ where $f'(x) = 0$ is dense in $I$? 

A:

In general you can't find such a neighborhood, consider e.g. $x^k \sin(x^{-1})$ for some sufficiently large k (depending on how often you want the function to be differentiable).
If you assume that $f$ is a (nonconstant) analytic function, then the roots of $f'$ are isolated, see here.
I am unsure what happens if the function is smooth (i.e. infinitely often differentiable) but not analytic. Maybe someone else can provide an answer.
Edit: As Barry Cipra and zhw. pointed out in the comments, $\exp(-x^{-2}) \sin(x^{-1})$ is an example in this case.

