10

Let $f:\mathbb{R}\to\mathbb{R}$ be continuous and such that $f(x)\in \mathbb{Q}$ if $x\in\mathbb{Q}$. My question is: can the function be nowhere differentiable or is there a point where it has a derivative?

Other than the Weierstrass function, I am not familiar with any other nowhere differentiable functions, especially ones that map the rationals to the rationals. My feeling is that there must be a point where the derivative exists but I have no idea where to even start thinking about this question, so any suggestions are appreciated.

Moishe Kohan
  • 111,854
Ivan
  • 2,634

1 Answers1

12

Ok, take any nowhere differentiable continuous function $g: \mathbb R\to \mathbb R$. The image $g(\mathbb Q)=A$ is a countable subset of the real line, hence, there is another countable subset $B\subset \mathbb R$ such that $C=A\cup B$ is dense in $\mathbb R$. Now, for every countable dense subset $D\subset \mathbb R$ there is a diffeomorphism $h: \mathbb R\to\mathbb R$ such that $h(D)=\mathbb Q$. (See the references in my answer here.) Apply this to $D=C$ and then consider the composition $f=h\circ g$. I will leave you to check that $f$ satisfies the required properties.

Edit. For this proof to work one really needs $h$ to be a diffeomorphism: A strictly increasing surjective smooth function would not be enough. Accordingly, I do not see why this is a duplicate of this question.

Moishe Kohan
  • 111,854