Give an example of a topological space $(X,\tau)$, a subset $A\subset X$ that is dense in $X$ (i.e., $\overline{A} = X$), and a continuous function $f:A\to\mathbb{R}$ that cannot be continually extended to $X$, that is, a $f$ for such do not exist a continuous function $g:X\to \mathbb{R}$ such that $f(x) = g(x)$ for all $x\in A$.
I just proved that if $f,g:X\to\mathbb{R}$ are continuous and agree in a dense subset $A\subset X$ then they're equal.
I thought in $X=\mathbb{R}$ with usual topology and $A = \mathbb{R}-\{0\} =:\mathbb{R}^*\ $, so I think $f:\mathbb{R}^*\to\mathbb{R}, f(x) = x^{-1}$ is a continuous function that cannot be continually extended to $\mathbb{R}$. I'm quite sure of this, but I'm stuck in proving it using the definition of continuity in general topological spaces.
Also, I'm quite confused on how this asked example is not a counterexample of what I proved.
Thanks in advance.