I found the following question in GRE 1268 practice test. I was wondering if you could tell me how to approach this problem since everytime I encounter a similar problem I have troubles solving it. Thanks for your help!
The function $f:\mathbb{R} \rightarrow \mathbb{R}$ is defined as follows,
$$f(x) = 3x^2 \text{ if } x \in \mathbb{Q}$$ and $$f(x) = -5x^2 \text{ if } x \notin \mathbb{Q}$$
Which of the following is true?
A) f is discontinuous at all $x \in \mathbb{R}$
B)f is continuous only at $x = 0$ and differentiable only at $x = 0$
C) f is continuous only at $x = 0$ and nondifferentiable at all $x \in \mathbb{R}$
D) f is continuous at all $x \in \mathbb{Q}$ and nondifferentiable at all $x \in \mathbb{R}$
E) f is continuous at all $x \notin \mathbb{Q}$ and nondifferentiable at all $x \in \mathbb{R}$.