# Finding the point of differentiability of a real valued function.

Let $f:(0,2)\rightarrow \mathbb{R}$ be defined by

$f(x)=x^2$ if $x\in (0,2)\cap \mathbb{Q}$ and

$f(x)=2x-1$ if $x\in (0,2)- \mathbb{Q}$

Check for the points of differentiability of $f$ and evaluate the derivative at those points.

My attempt: I know that this function $f$ is only in continuous only at the point $x=1$. But I am not sure how to check the differentiability at the point $x=1$. Any suggestions are welcome.

Your function isn't continues on $(0,2)$ unless in $x=1$. For differentiability in this point by definition $$f'(1)=\lim_{x\to1}\dfrac{f(x)-f(1)}{x-1}= \begin{cases} \lim_{x\to1}\dfrac{x^2-1}{x-1}=2&x\in\mathbb{Q}\\ \lim_{x\to1}\dfrac{2x-1-1}{x-1}=2&x\notin\mathbb{Q} \end{cases}$$ so the function is continues and differentiable in $x=1$.
• When u compute the right-hand limit, why are considering $x'$s only rational numbers? $x$ can also be an irrational number. But I guess in any case the limit will be 2. Is not it? – Babai Jul 23 '18 at 8:50