Let $\chi_\mathbb{Q}(x)$ denote the characteristic function of the rationals. Fix $a\in\mathbb{R}$. I would like to prove that $f(x)=(x-a)\chi_\mathbb{Q}(x-a)$ is continuous nowhere, except at $x=a$.
Here is my attempt: Fix $c\in\mathbb{R}$ with $c\neq a$. Either $a\in\mathbb{Q}$ or $a\notin\mathbb{Q}$, and either $c\in\mathbb{Q}$ or $c\notin\mathbb{Q}$, so we have four cases.
Conisder $a,c\in\mathbb{Q}$. Choose $\epsilon=|a-c|/2$. Then, for any $\delta>0$, there exists $x_0\notin\mathbb{Q}$ such that $|x_0-c|<\delta$. Then, $$|f(x_0)-f(c)|=|0-(c-a)|\nless\frac{|a-c|}{2}=\epsilon$$
Next, consider $a\in\mathbb{Q}$ and $c\notin\mathbb{Q}$. For any $\delta>0$, there exists $x_0\in\mathbb{Q}$ such that $|x_0-c|<\delta$. Choose $\epsilon=|x_0-a|/2$. Then, $$|f(x_0)-f(c)|=|(x_0-a)|\nless\frac{|x_0-a|}{2}=\epsilon$$
Not too sure how to proceed with the last two cases. Also, is there an easier way to do this, without splitting into four cases?
Let $c\in \mathbb{R}$, and let $(r_n)_n$ be a sequence of irrational numbers such that $r_n\to c$ as $n\to \infty$. Denote $x_n:=a+r_n$. Then one has
$$ f(x_n)=0 \quad\forall n.$$
On the other hand,
$$ f(\lim_{n\to \infty} x_n)=f(a+c)=c\cdot\chi_{\mathbb{Q}}(c). $$
This shows that if $f$ is continuous at $a+c$, then $c=0$.
In order to check that $f$ is continuous at $a$, let $(y_n)_n$ be any sequence of real numbers converging to $a$, and let $s_n:=y_n-a$. We want to check that $f(y_n)\to 0$. Since $f(y_n)=0$ whenever $s_n$ is irrational, we can assume without loss of generality that $s_n\in \mathbb{Q}$ for all $n$. In this case, you have $f(y_n)=s_n\to 0$ as desired, so $f$ is continuous at $a$.