1. ## Proving differentiability

Let f(x)=
x^2 if x rational
0 if x is irrational
Prove f is differentiable at 0

f(0)=0
So at $x=0$
$lim_{h\rightarrow0}=\frac{f(0+h)-f(0)}{h}
$

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

Case 1: h rational, then
$lim_{h\rightarrow0}=\frac{h^2}{h}=h=0
$

Case 2: h irrational
$lim_{h\rightarrow0}=\frac{0}{h}=0
$

Hence
$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?

2. This isn't quite right - you can't just pick and choose which values of $h$ you attain. A cleaner way to do this is to use the Sandwich theorem, combined with taking the limit from the right and from the left. First, from the right, we have $h>0$. Then, $0\leq f(h)\leq h^2$. Dividing by $h$ gives $0\leq \frac{f(h)}{h}\leq h$. Taking the limit as $h\to 0^+$ shows that $\frac{f(h)}{h}\to 0$.

I'll leave the left-hand approach to you. Good luck.