Examples of badly behaved derivatives

Of course every continuous function is a derivative, so your question seems like it could be reinterpreted as the characterization problem for derivatives: that is, give "nice" necessary and sufficient conditions on a function $f: [a,b] \rightarrow \mathbb{R}$ for it to be the derivative of some other function (one-sided, at the endpoints).

As others have pointed out, any derivative must be a Darboux function -- i.e., satisfy the conclusion of the Intermediate Value Theorem -- and also a Baire class one function -- i.e., a pointwise limit of continuous functions. The latter implies that the set of discontinuities is meager. A lot of work has been done seeking to understand "how much bigger" the class of Darboux, Baire Class 1 functions is than the class of derivatives.

Here are some references:

Bruckner, A. M.; Leonard, J. L. Derivatives. Amer. Math. Monthly 73 1966 no. 4, part II, 24--56.

http://math.uga.edu/~pete/BrucknerLeonard66.pdf or http://classicalrealanalysis.info/documents/andy1966.pdf

Bruckner, Andrew M. Differentiation of real functions. Lecture Notes in Mathematics, 659. Springer, Berlin, 1978. x+247 pp.

https://projecteuclid.org/euclid.bams/1183545222

Bruckner, Andrew M. The problem of characterizing derivatives revisited. Real Anal. Exchange 21 (1995/96), no. 1, 112--133.

https://projecteuclid.org/euclid.rae/1341343228


Derivatives are like continuous functions in that both have the intermediate value property, but they need not have the extreme value property. Gelbaum and Olmstead, Counterexamples in Analysis, gives as example 3.7 the function $$ f(x) = \begin{cases} x^4 e^{-\frac{1}{4}x^2}\sin\frac{8}{x^3}, & x \ne 0 \\ 0, & x=0 \end{cases} $$ for which $f'$ exists everywhere, but does not achieve its supremum on the compact interval $[-1,1]$.

On the other hand, a derivative cannot have too many discontinuities. Lars Olsen at http://mathforum.org/kb/message.jspa?messageID=281579&tstart=0 points out that a derivative is a pointwise limit of the continuous functions and hence of Baire class at most 1, and therefore its set of discontinuities is meager (in particular, has dense complement).


Talking about how bad may be the derivative of an everywhere derivable function on the interval [a,b], the natural example that occurs to my mind is: a Pompeiu derivative, that is, a derivative that vanishes in a dense set (these weird functions, however, constitue a closed linear space of $C^0[a,b]$, while it's not even obvious that they are closed wrto addition!). For an account on the subject you may refer e.g. to the above quoted book by Andrew M. Bruckner Differentiation of real functions: it's also in the CRM series now (here is a preview: http://books.google.it/books?id=fXfEG-F2zJUC&printsec=frontcover&source=gbs_book_other_versions#v=onepage&q&f=false)

For a quick reference, you may also have a look to the wiki article http://en.wikipedia.org/wiki/Pompeiu_derivative (it's me who wrote it ;-) )