Let f(x)=

x^2 if x rational

0 if x is irrational

Prove f is differentiable at 0

f(0)=0

So at $\displaystyle x=0$

$\displaystyle lim_{h\rightarrow0}=\frac{f(0+h)-f(0)}{h}

$

$\displaystyle lim_{h\rightarrow0}=\frac{f(h)}{h}

$

Case 1: h rational, then

$\displaystyle lim_{h\rightarrow0}=\frac{h^2}{h}=h=0

$

Case 2: h irrational

$\displaystyle lim_{h\rightarrow0}=\frac{0}{h}=0

$

Hence

$\displaystyle lim_{h\rightarrow0}=\frac{f(0+h)-f(0)}{h}

$

and f is differentiable at 0

QED

Am I expressing this proof correctly? Are all my steps rigorous?