[Math] Prove that a function is continuous in a metric space

analysiscontinuitymetric-spaces

Here is the problem :

Let $(X,d)$ be a metric space, and let $A$ be a non-empty closed subset of $X$ $($$\varnothing\neq$$A$$\subset$$X)$ , and let $f:A\to\mathbb{R}$ be a bounded continuous function . I want to prove that function $g:X\!\smallsetminus\!A\to \mathbb{R}$ that is defined by
$$g(x)=\inf\{\,f(y)d(x,y):y\in A\}$$
is continuous .

I am thinking that since we have $\inf\{d(x,y):y\in A\}$ and $A$ is a non-empty closed subset of $X$ we should use the fact that $\text{dist}(x,A)$ metric is continuous if $A$ is a closed nonempty subset of $X$. Also since $f:A\to\mathbb{R}$ is a bounded continuous function and $A$ is closed its infimum should be its minimum. So in a way the product of $\inf\{f(A)\}\text{dist}(x,A)$ is continuous. I am not really sure if I am on the right path here. I could use some help. Thank you.

Best Answer

Let $M=\sup\lvert\,f(x)\rvert$. Then $$ \lvert\,f(y)d(x_1,y)-f(y)d(x_2,y)\rvert \le \lvert\,f(y)\rvert \lvert d(x_1,y)-d(x_2,y) \lvert \le M \lvert d(x_1,y)-d(x_2,y) \lvert\le M d(x_1,x_2), $$ since $\lvert d(x_1,y)-d(x_2,y)\rvert \le d(x_1,x_2)$, and hence $$ f(y)d(x_2,y)-M d(x_1,x_2)\le f(y)d(x_1,y)\le f(y)d(x_2,y)+M d(x_1,x_2). $$ Thus $$ g(x_1)=\inf_y f(y)d(x_1,y)\le f(y)d(x_2,y)+M d(x_1,x_2), $$ and hence for every $y$ $$ g(x_1)-Md(x_1,x_2)\le f(y)d(x_2,y), $$ and thus $$ g(x_1)-Md(x_1,x_2)\le \inf_y f(y)d(x_2,y)=g(x_2) $$ or $$ g(x_1)-g(x_2)\le Md(x_1,x_2). $$ Interchanging $x_1$ and $x_2$ we obtain $$ g(x_2)-g(x_1)\le Md(x_1,x_2), $$ and thus $$ \lvert g(x_2)-g(x_1)\rvert \le Md(x_1,x_2). $$