Extending continuous function of space to continues function on one-point compactification I came across an interesting problem.
Let $A$ be locally compact and  $B$ be its one-point compactification. I WTS that a continuous function $g : A \rightarrow \mathbb{R}$ can be extended to a continuous function $\bar{g}: B \rightarrow \mathbb{R}$ iff there is some constant $c$ such that $g − c$ vanishes.
We say that $g$ vanishes if for any $\epsilon >0$, there is some compact $C\subset A$ such that $|g(m)|<\epsilon$ for any $m\in A \setminus C$.
I honestly have no clue how to prove this, but I'm curious to see how this is true, as it's not the criterion I'd expect for extending a continuous function. How does the proof of this go? 
 A: Let $g:A\to\mathbb{R}$ and $*$ be the unique point added to $A$, i.e. $B=A\cup\{*\}$.

"$\Rightarrow$" Let $g':B\to\mathbb{R}$ be the extension of $g$. Put $c:=g'(*)$. We will show that $g-c$ vanishes.
So pick $\epsilon > 0$ and define
$$U=\{b\in B\ |\ |g'(b)-c| < \epsilon\}$$
So $U=f^{-1}(-\infty, \epsilon)$ for $f(b)=|g'(b)-c|$. Since $g'$ is continous then so is $f$ and thus $U$ is open in $B$.
Therefore $C:=B\backslash U$ is compact (being a closed subset of a compact space). Note that $*\not\in C$ since $*\in U$ because $|g'(*)-c|=0<\epsilon$. Thus $C=A\cap C$ and therefore $A\cap C$ is a compact subset of $A$ that satisfies desired properties. This completes the proof. $\Box$

"$\Leftarrow$" Let $c\in\mathbb{R}$ be such that $g-c$ vanishes. Define 
$$g':B\to\mathbb{R}$$
$$g'(x)=\begin{cases}
g(x) & \mbox{ if } x\in A \\
c & \mbox{ if } x= *
\end{cases}$$
Obviously $g'$ extends $g$. All that is left is to prove that $g'$ is continous. Can you complete the proof?
So it is enough to prove that if $c\in(a,b)$ for some $a,b\in\mathbb{R}$ then $g'^{-1}(a,b)$ is open in $B$. Let $x\in g'^{-1}(a,b)$. If $x\neq *$ then there exists an open neighbourhood $U$ of $x$ in $A$ (and thus in $B$) such that $g'(U)=g(U)\subseteq (a,b)$ (by continuity of $g$). Therefore the only thing that we actually have to prove is the existence of a neighbourhood $U$ of $*$ such that $g'(U)\subseteq (a,b)$.
Take $\epsilon := \min\big(|b-c|, |a-c|\big) > 0$. Since $g-c$ vanishes then there exists a compact subset $C\subset A$ such that
$$g(A\backslash C)\subseteq (c-\epsilon, c+\epsilon)\subseteq (a,b)$$
By the definition of the one point compactification $U:=A\backslash C\cup\{*\}$ is open in $B$ and since $g'(*)=c$ then $g'(U)\subseteq (a,b)$ which completest the proof. $\Box$
