Is this function differentiable at 0? I would like to know if this function is differentiable at the origin:
$$f(x) =
\left\{
 \begin{array}{cl}
  x+x^2  & \mbox{if } x \in \mathbb{Q}; \\
  x & \mbox{if } x \not\in \mathbb{Q}. \end{array}
\right.$$
Intuitively, I know it is, but I don't know how to prove it. 
Any ideas?
Thanks a lot.

A function $f$ defined in a neighborhood of $x=0$ is differentiable at $0$ if the limit
$$\lim_{x\to0}{f(x)-f(0)\over x-0}$$
exists. Now
$$m(x):={f(x)-f(0)\over x-0}=\cases{1+x\quad&$(x\in\Bbb Q)$\cr 1&$(x\notin\Bbb Q)$\cr}\qquad(x\ne0)\ .$$
It follows that $|m(x)-1|\leq|x|$ for all $x\ne0$, from which we immediately conclude that $\lim_{x\to0} m(x)=1$, or $f'(0)=1$.
