Take
$$f(x) = \begin{cases} 1,\quad x∈ℚ \\ 0,\quad x∉ℚ \end{cases}$$
and
$$g(x) = \begin{cases} x,\quad x∈ℚ \\ 0,\quad x∉ℚ \end{cases}$$
where $f(x)$ is not continuous at $a=0$, in fact it's not continuous anywhere, and $g(x)$ is continuous at $a=0$ but not elsewhere.
Now I understand the proof behind $f(x)$ not being continuous anywhere but I don't understand why $g(x)$ is continuous at $a=0$.
I used the logic that $ℚ$ is dense to prove $f(x)$ is not continuous anywhere but given $g(x)$ looks similar, I don't understand how it can be different. I'd appreciate any pointers or tips.