# Differentiability of weird function

1. Oct 12, 2005

### Ara macao

Let f(x) = x if x rational and f(x) = 0 if x is irrational

Let g(x) = x^2 if x rational and g(x) = 0 if x is irrational.

Both functions are continuous at 0 and discontinuous at each x != 0.

How do I show that f is not differentiable at 0?
How should I show that g is differentiable at 0? Give g'(0) as well.

Thanks...

2. Oct 12, 2005

### HallsofIvy

Staff Emeritus
Use the definition: $$f'(0)= lim_{h->0}\frac{f(h)}{h}$$.
but $$\frac{f(h)}{h}$$ is 1 if x is rational, 0 if x is irrational. What does that tell you about the limit?

$$\frac{g(h)}{h}$$ is h is x is rational, 0 if x is irrational.