# Construct a function that is differentiable only on the rationals.

In the spirit of having handy counter examples, is it possible to construct a function that is differentiable on all of the rational numbers and nowhere else?

Similarly, if a function is holomorphic at a point, must it always be holomorphic in an open neighborhood around that point?

Constructive proofs and counterexamples will be given priority.

-
Doesn't holomorphic at p by definition mean complex differentiable in a neighbourhood of p? If so, the answer to your second question is trivially yes. –  Chris Eagle Feb 20 '12 at 21:45
'Holomorphic at a point' is defined to be 'holomorphic on some neighbourhood of that point' –  Matt Feb 20 '12 at 21:45
For the rationals question, the answer is yes by Zahorski's Theorem. –  André Nicolas Feb 20 '12 at 22:04
André is right –  Georges Elencwajg Feb 20 '12 at 22:40
I might have misspoke, I meant to say C-differentiable instead of holomorphic. I don't know if you distinguish between the two at a point. A function is C-differentiable if the difference quotients have a limit at a point. The function needs to be defined in an open neighborhood, but certainly not C-differentiable (I think). Also, a function need not necessarily be C-differentiable in a neighborhood by definition, so the top two responses are wrong with the definition I'm using. –  Alex Lapanowski Feb 21 '12 at 1:24

Though I have not checked in detail, something like $$f(x) = \sum_{n=0}^\infty \cos (\pi \; n! \; x)/2^n$$ may be a function that is differentiable on all of the rational numbers and nowhere else.