# How to discuss the continuity and differentiability of $f(x)$?

I have this problem on my Real Analysis problem set:

Let $I_{A}(x)$ be the characteristic function of any set A. Consider $\begin{cases} f(x) = x^2 I_{\mathbb{Q}}(x)\\ g(x) = x^2 I_{\mathbb{R - Q}}(x) \end{cases}$

Now, consider the following statements and say if they are false or true :

a) $f(x)$ is continous on $0$ but not continuous anywhere else

b) $f(x)$ is differentiable on $0$ but not differentiable nowhere else

c) $g(x)$ is not continuous on $0$

d) $g(x)$ is not differentiable on $0$

Well, I see that the solution may have something to do with applying the definition of a derivative and also the definition of a continuous function. But this characteristic function thing gets me a bit confused when taking limits. Any ideas? Thank you so much in advance!

• Hint: Consider for example the number $1$, then $f(1)=1$. Now take a sequence $(x_n)_n$ such that $x_n\rightarrow 1$ and all $x_n\in \mathbb{R}\setminus\mathbb{Q}$. Then $f(x_n)=0$ for each $n$, hence $\lim_{n\rightarrow \infty}f(x_n)=0\neq f(\lim_{n\rightarrow \infty}x_n)$. They are all pretty similar. – Mathematician 42 Apr 21 '16 at 13:58
• Thanks! But that proves that $f(x)$ is not continuous on $1$, right? Of course, one could always do the same for any rational, other than $0$, but what about differentiability on $0$? – Raul Guarini Apr 25 '16 at 0:02
• Use the definition, you need to show that $\lim_{x\rightarrow 0}\frac{f(x)-f(0)}{x-0}$ exists. – Mathematician 42 Apr 25 '16 at 6:26