For a continuous function $f : [0,1] \to {\mathbb R}$, let us set
$$ X_f=\lbrace x \in [0,1] \bigg| f'(x)=0 \rbrace $$
(for a $x\not\in X_f$, $f'(x)$ may be a nonzero value or undefined).
There are well-known "Cantor staircase" examples where $X_f$ is a dense open set in $[0,1]$. Is there a continuous $f$ with $X_f={\mathbb Q}\cap [0,1]\,$ ? Is there a continuous $f$ with $X_f=[0,1] \setminus {\mathbb Q}$ ?
UPDATE 06/02/2012 Since $X_f$ is dense in $[0,1]$, the continuity set of $f'$ is included in $X_f$. Since $X_f$ has empty interior, the continuity set of $f'$ cannot be a $G_{\delta}$ in any subinterval of $[0,1]$, so $f$ cannot be everywhere differentiable on any subinterval of $[0,1]$.
All the links proposed so far in the comments are about everywhere differentiable functions, so they do not suffice to answer my question.
An interesting sub-question is obtained if, in addition, we also require $f$ to be increasing (so that $f$ will be a homeomorphism from $[0,1]$ onto some other interval).
It is easy enough to construct a $f$ and control the behaviour $f'$ on a countable set, by the usual step-by-step procedure. But it seems very hard to say anything at all on the behaviour of $f'$ on the other points of $[0,1]$.
SECOND UPDATE 06/02/2012 As noted in the link provided in a comment below, it follows from Cousin's lemma that if $f$ is a continuous function such that $f'=0$ everywhere except for a countable set, then $f$ is constant.
So there is no $f$ such that $X_f=[0,1] \setminus {\mathbb Q}$ : the answer to my second question is NO. My first question remains open however.
The answer to the first question is YES. In fact, one can show the following stronger statement :
THEOREM. There exists an increasing homeomorphism $f: [0,1] \to [0,1]$, such that $f'(q)=0$ for all $q\in {\mathbb Q}$ and any irrational $x\in [0,1]$ is contained in arbitrary small intervals $[u,v]$ with $\frac{f(v)-f(u)}{v-u} \geq 1$ (so that $f'(x)$, if defined, is $\geq 1$).
We use a familiar "inbreeding", piecewise and iterative construction, enumerating the rationals and imposing $f'(q)=0$ for each $q$ one by one, keeping at the same time a tight net of values $x,y$ such that $\frac{f(y)-f(x)}{y-x} \geq 1$. Formally :
DEFINITION. Let $f,g$ be two function $[a,b] \to {\mathbb R}$. We say that $(f,g)$ is a claw on $[a,b]$ when
(1) $f(a)=g(a),f(b)=g(b),f'(a)=g'(a)=f'(b)=g'(b)=0$ and
(2) $f(x)<g(x)$ when $a<x<b$.
If, in addition, one has
(3) For any $x\in ]a,b[$, there are $u<v$ in $]a,b[$ with $x\in [u,v]$, $\frac{f(v)-g(u)}{v-u} \geq 1$, then we say that $(f,g)$ is a tight claw.
FUNDAMENTAL LEMMA. If $(f,g)$ is any claw on $[a,b]$, then there is another claw $(F,G)$ with $f \leq F \leq G \leq g$ on $[a,b]$ and $(F,G)$ is tight. We may further impose that the supremum norm $||F-G||_{\infty}$ be $\lt \epsilon$ for $\epsilon$ as small as we want.
{\bf Proof of theorem using fundamental lemma}. We construct by induction two sequences $f_n,g_n$ of homeomorphisms $[0,1] \to [0,1]$ such that :
(i) $f_n \leq g_n$ on $[0,1]$
(ii) $(f_n,g_n)$ is a tight claw on each interval $I_{n,k}=[\frac{k}{n!},\frac{k+1}{n!}]$ for $0 \leq k\ \leq n!$.
(iii) $||f_n-g_n||_{\infty} \leq \frac{1}{n}$.
We start with $f_0(x)=4x^3-3x^4$ and $g_0(x)=3x^2-2x^3$. Suppose now that $(f_n,g_n)$ have already been constructed. The two maps $f_n$ and $g_n$ coincide on the finite set $X_n=\lbrace \frac{k}{n!} | 0 \leq k \leq n! \rbrace$. There is an increasing map $\phi : X_{n+1} \to [0,1]$, extending $f_{|X_n}=g_{|X_n}$, such that $f_n \lt \phi \lt g_n $ on $X_{n+1} \setminus X_n$.
On each interval $I_{n+1,k}$, there is a claw $(p_k,q_k)$ with $f_n \leq p_k \leq q_k \leq g_n$, and $p_k$ nad $q_k$ coincide with $\phi$ on the extremities of the interval. By fundamental lemma, there is a tight claw $(r_k,s_k)$ on $I_{n+1,k}$ with $p_k \leq r_k \leq s_k \leq q_k$, and $||r_k-s_k||_{\infty} \leq \frac{1}{n}$.
We may then take $f_{n+1}$ ($g_{n+1}$, respectively) to be the unique function that coincides with $r_k$ ($s_k$, respectively) on $I_{n+1,k}$. This completes the inductive construction.
Then by (i) and (iii) we have ${\sf sup}(f_n)={\sf inf}(g_n)$ ; let us call $f$ this function. Then $(f_n)$ nad $(g_n)$ converge uniformly towards $f$, and $f$ is a homeomorphism $[0,1] \to [0,1] $. We have for $x \in I_{n,k}$ and $q=\frac{k}{n!}$, and any $m\geq n$,
$$ f_m(q)=g_m(q)=f(q), \ \frac{f_n(x)-f(q)}{x-q} \leq \frac{f(x)-f(q)}{x-q} \leq \frac{g_n(x)-f(q)}{x-q} $$ whence $f'(q)=0$ on the right. Similarly, $f'(q)=0$ on the left.
The fundamental lemma can be shown from the following :
LEMMA 1. Let $(f,g)$ be a claw on $[a,b]$. Then there are three increasing sequences $(x_k)_{k\in \mathbb Z},(y_{1,k})_{k \in \mathbb Z}$ and $(y_{2,k})_{k \in \mathbb Z}$, with $$ {\sf lim}_{k \to -\infty} x_k=a, \ {\sf lim}_{k \to +\infty} x_k=b, \ $$
$$ {\sf lim}_{k \to -\infty} y_{1,k}={\sf lim}_{k \to -\infty} y_{2,k}=f(a)=g(a),\ {\sf lim}_{k \to +\infty} y_{1,k}={\sf lim}_{k \to +\infty} y_{2,k}=f(b)=g(b) $$
and $$ \frac{y_{1,k+2}-y_{2,k}}{x_{k+2}-x_k} \leq 1, f(x_k) \lt y_{1,k} \lt y_{2,k} <g(x_k), |y_{2,k}-y_{1,k}| \lt \epsilon $$
{\bf Proof of fundamental lemma from lemma 1.} Set $F(x_k)=y_{1,k}, G(x_k)=y_{2,k}$ for all $k\in \mathbb Z$ and interpolate in-between (take $F$ and $G$ affine on $[x_k,x_{k+1}]$, for instance).
Finally, lemma 1 follows from the iteration of
LEMMA 2. Let $(f,g)$ be a claw on $[a,b]$, and let $a',b'$ such that $a<a'<b'<b$. Then there are three increasing finite sequences $(x_k)_{|k| \leq M},(y_{1,k})_{|k| \leq M}$ and $(y_{2,k})_{|k| \leq M}$, with $$ x_{-M} \leq a', \ b' \leq x_{M} $$
$$ \frac{y_{1,k+2}-y_{2,k}}{x_{k+2}-x_k} \leq 1, f(x_k) \lt y_{1,k} \lt y_{2,k} <g(x_k), |y_{2,k}-y_{1,k}| \lt \epsilon $$