Real analysis is famous for its counterexamples. It's usually not obvious how to find these examples, and that irritated me, because I needed to learn them by rote. Well, today I reduced number of unobvious counterexamples by one.
Today I examined one girl from 10th grade in calculus, and she got Darboux theorem. After she proved the theorem, I asked, is it a consequence of Bolzano's theorem. "No, because derivative may not be continuous". "Can you then show me an example of differentiable function, whose derivative isn't continuous?"
She couldn't, so I had to ponder it myself. Of course, I didn't remember the example.
The first try was to integrate some non-continuous function, but it cannot succeed — we have no guarantee that integral will be differentiable.
Then I looked at Darboux theorem again. Intermediate value property is very strong — ordinary discontinuous functions don't satisfy it and therefore cannot claim to be a derivative. If derivative is monotonic in some neighbourhood of a point, then intermediate value property force it to be continuous in that point. Now it becomes clear that we want to search for a function, which oscillates infinitely frequently in the neighbourhood of a point. So, sin(1/x) naturally comes to mind. It remains to multiply by x2 to achieve necessary degree of smoothness, and here it is!