Nasty examples for different classes of functions

Let $f: \mathbb{R} \to \mathbb{R}$ be a function. Usually when proving a theorem where $f$ is assumed to be continuous, differentiable, $C^1$ or smooth, it is enough to draw intuition by assuming that $f$ is piecewise smooth (something that one could perhaps draw on a paper without lifting your pencil). What I'm saying is that in all these cases my mental picture is about the same. This works most of the time, but sometimes it of course doesn't.

Hence I would like to ask for examples of continuous, differentiable and $C^1$ functions, which would highlight the differences between the different classes. I'm especially interested in how nasty differentiable functions can be compared to continuously differentiable ones. Also if it is the case that the one dimensional case happens to be uninteresting, feel free to expand your answer to functions $\mathbb{R}^n \to \mathbb{R}^m$. The optimal answer would also list some general minimal 'sanity-checks' for different classes of functions, which a proof of a theorem concerning a particular class would have to take into account.


The Wikipedia article http://en.wikipedia.org/wiki/Pompeiu_derivative gives one example of how bad a non-continuous derivative can be.

One can show that any set whose complement is a dense intersection of countably many open sets is the point of discontinuities for some derivative. In particular a derivative can be discontinuous almost everywhere and on a dense set.

See the book "Differentiation of Real Functions" by Andrew Bruckner for this and much more.


Although this is maybe not a good example of very "nasty" functions, you could look at $f_i = x^i \sin(1/x)$ for $i=0,1,2,3$ in order to see the distinction between those classes of functions. If you set $f_i(0)=0$ for all $i$, then $f_0$ is not continuous in $0$, $f_1$ is continuous but not differentiable in $0$, $f_2$ is differentiable but not $C^1$ and $f_3$ is $C^1$.