$f(x) = \begin{cases} x & x \in \mathbb{Q} \\ -x & x \in \mathbb{I} \end{cases}$
I wish to show that $f(x)$ is continuous at only $0$. Thus, if it is differentiable, it would only be differentiable at $0$.
$\textbf{My attempt (Continuity)}$
$f(x)$ only continuous at $0$
Choose $\delta = \epsilon$
Then, if $|x-0| = |x| < \delta$
$|f(x) - f(0)| = |f(x)| \leq |x| < \delta = \epsilon$
$f(x)$ discontinuous anywhere else ($c \neq 0)$
Choose $\delta =$ (need help)
Then, if $|x-c| < \delta$
$|f(x) - f(c)| \leq |x+c|$
Unsure of where to go from here.
$\textbf{Differentiable}$
$f(x)$ could only possibly be differentiable at $0$ since it was continuous at $0$
$$\lim_{x\to c} \frac{f(x) - f(c)}{x - c}$$
Set $c = 0$
$$\lim_{x\to 0} \frac{f(x) - f(0)}{x - 0} = \lim_{x\to 0} \frac{f(x)}{x}$$
$$ = f(x) = \begin{cases} 1 & x \in \mathbb{Q} \\ -1 & x \in \mathbb{I} \end{cases}$$
Some how?
Any help would be appreciated.