Prove that f is differentiable at $0$! Not continuous though, Right!? Suppose $f(x)$ equals $x^2$ when $x\in \mathbb{Q}$ and $0$ when $x \not\in \mathbb{Q}$
Prove that $f$ is differentiable at $0$ and find the derivative $f'(0)$
Shouldn't this be obvious, since $x^2$ at $0 = 0^2 =0$ and all the values around it are irrational, and therefore equal 0, and therefore the derivative of $2x$ or $0$ equals $0$?
I don't know how I would prove this mathwise! cause it is not continuous surely!!
 A: In fact, $f$ is continuous in $0$ (not at any other point, though).
To see this, let $\varepsilon > 0$ and choose $\delta := \sqrt{\varepsilon} > 0$. For $x \in \mathbb{R}$ with $|x-0|<\delta$ you then have two cases:


*

*$x \in \mathbb{Q}$. Then $ |f(x) - f(0)| = |x|^2 < \delta^2 = \varepsilon$.

*$x \notin \mathbb{Q}$. Then $|f(x) - f(0)| = 0< \varepsilon$.
In order to show that $f$ is differentiable, use the definition, i.e. try to calculate
$$f'(0) = \lim_{h\rightarrow 0}\frac{f(0+h) - f(0)}{h}.$$
Show that this limit exists and equals $0$. This again implies that $f$ is continuous in $0$, as it is differentiable.
A: To say that all the values around $0$ are irrational is false.  No matter how small you make an open interval containing $0$, there will be some rational numbers in the interval.  If that were not so, the the sequence $1,1/2,1/3,1/4,\ldots$, consisting entirely of rational numbers, would not approach $0$.
It is true that if "all the value around $0$" were numbers whose images under the function are $0$, then the derivative at $0$ would be $0$.
But as it is, there is more work than that to do to find the derivative.
The function you've defined is continuous at $0$, but not at any other point.  A function cannot be differentiable at a point without being continuous at that point.
Where you say "irrational, and therefore equal to $0$",  I surmise that you mean "irrational, and therefore mapped to $0$ by this function".
Look at
$$
f'(0)=\lim_{t\to0}\dfrac{f(t)-f(0)}{t-0} = \lim_{t\to0} \frac{f(t)}{t} = \lim_{t\to0} \left.\begin{cases} \dfrac{t^2}{t} & \text{if }t\in\mathbb Q, \\[10pt] \dfrac 0 t & \text{if }x\not\in\mathbb Q,  \end{cases}\right\} = \lim_{t\to0} \begin{cases} t & \text{if }t\in \mathbb Q, \\ 0 & \text{if }t\not\in\mathbb Q. \end{cases}
$$
The quantity after "$\lim$" can be made as close as desired to $0$ by making $t$ close enough but not equal to $0$.  Hence the limit is $0$.
