[Math] Example of a continuous function that don’t have a continuous extension

continuitygeneral-topology

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.

Best Answer

Define $f(x)=1/x$ like you did, and assume you can find a continuous extension $g : \mathbb{R}\to\mathbb{R}$. Well this $g $ takes a real numbered value at $0$, namely $-\infty < g (0) < \infty $, and it agrees with $f $ at non-zero values.

One definition of continuity is that given a net of points in $X $ converging to $x_0$ and a function $g $, then the images converge to $g(x_0) $. Since $\mathbb{R}$ is a metric space, we can use sequences instead of nets. But given a sequence of real numbers $(x_n )_{n=1}^{\infty} $ converging to $0$, the sequence $(g (x_n))_{n=1}^{\infty} $ converges to either positive or negative $\infty $. So it does not converge to $g (0) $. So $g $ is not continuous


BTW regarding your question on the results you proved. You proved a result about two functions that were continuous on the entire space, who agree on a dense subset. But the main question of your post is regarding a function who is not assumed to be continuous on the entire space, and comparing it to one that is continuous on the entire space. So the main example is not countering your original result