I saw an interesting question:
Let $D(x)=\begin{cases} 1 & \text{if } x \in \mathbb{Q}, \\ 0 & \text{if } x \in \mathbb{R} \setminus \mathbb{Q}\end{cases}$
Let $f(x) = x \cdot D(x)$.
Which is true:
- $f$ is not differentiable in $x=0$
- $f'(0)=0$
- $f'(0)=\frac{1}{2}$
- $f'(0)=1$
So, what's the right answer? I know that in every neighborhood of $x$ there are points where $D(x)=1$ but also points where $D(x)=0$, so how do I go about calculating this?
Thanks.