If the function f is defined as follows:
$\displaystyle f(x)=x^2$ for x rational
$\displaystyle f(x)=0$ for x irrational
How would you show that f is differentiable at $\displaystyle x=0$?
$\displaystyle f'(x) = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h} $
We need to show this limit exists when $\displaystyle x=0 $.
For this we need to compare $\displaystyle \limsup $ and $\displaystyle \liminf $.
For $\displaystyle x\neq 0 $, $\displaystyle x^2 > 0 $, so our $\displaystyle \limsup $ will only consider the sequence containing all points of the form $\displaystyle (x,x^2) $.
Thus $\displaystyle \limsup_{h\to 0}\frac{f(0+h)-f(0)}{h} = \lim_{h\to 0}\frac{(0+h)^2-0^2}{h} = \lim_{h\to 0}\frac{h^2}{h} = \lim_{h\to 0}h = 0 $.
Clearly our $\displaystyle \liminf $ will only consider the sequence containing all points of the form $\displaystyle (x,0) $.
Thus $\displaystyle \liminf_{h\to 0}\frac{f(0+h)-f(0)}{h} = \lim_{h\to 0}\frac{0}{h} = 0 $.
Since $\displaystyle \limsup=\liminf $, $\displaystyle \lim_{h\to 0}\frac{f(0+h)-f(0)}{h} $ exists and equals $\displaystyle 0 $.
Therefore $\displaystyle f'(0)=0 $.