While solving a problem on compactness
, I just came across this function, I need to know whether it is well defined or not and if is well defined then need to prove that this function is continuous.
Let $(X,d)$ be a non-compact metric space and $\{x_n\}$ be a sequence which has no accumulation points. Then show that there exits a continuous real-valued unbounded function.
In MathStackExchange, one defined (Existence of a continuous function which does not achieve a maximum. ) $g(x)=\inf_nd(x,a)+1/n$ and then asked to take $f(x)=\frac{1}{g(x)}$ now $g(x)$ is not zero anywhere and he said $g(x)$ is continuous and $f(x_n)=n $ and so the function $f$ is continuous and unbounded.
My doubt is this function $g$ well defined? If yes what does it really mean? what is that 1/n? how does it varies? If this function is well defined, kindly help me to prove how that it is continuous.
Given a sequence $\{x_n\}$ in $X$. Consider the following sequence in $\mathbb R$: $$a_{n,x}:=d(x,x_n)+\frac{1}{n}$$ where $x\in X$ is chosen to be fixed, and $n\in\mathbb N$. This is a well-defined sequence (in $\mathbb R$) without any doubt. And then in his construction he defined a new mapping $g:X\to\mathbb R$ by $$g(x)=\inf_{n\in\mathbb N}(a_{n,x}).$$ Since the sequence $a_{n,x}$ is bounded below (clearly) by $0$, we can always take $\inf$ and get a finite number. Thus the mapping $g$ is well-defined as well.
Edit: as for the continuity of $g$, I think you can mimic the proof in this answer Infimum of a metric is continuous. Maybe you will use the fact that $\inf(A+B)=\inf A+\inf(B)$ for two bounded below subsets of $\mathbb R$.