Show that $\tilde{g}$ is continuous on $X.$ Suppose that $X$ is a separable and completely metrizable space. Assume that $g:X \rightarrow \mathbb{R}$ is continuous.
Denote $A = \{ x \in X: g(x)<0 \}.$
Define $\tilde{g}:X \rightarrow \mathbb{R}$ given by $\tilde{g}(x)=g(x)$ if $x \in A$, $\tilde{g}(x) = 0$ if $x \not\in A.$

Question: Show that $\tilde{g}$ is continuous on $X.$

It suffices to check at 'boundary' of $A$, since $g$ and $0$ are continuous functions. 
I do not know how to check at boundary of a set. Any hint would be appreciated. 
 A: *

*If a map $f \colon X → Y$ is continuous on two closed subspaces $A, B ⊆ X$ covering $X$, i.e. $X = A ∪ B$, then it is continuous on all $X$.

*So it suffices to check that $\tilde g$ is continuous on the closed sets $\operatorname{cls A}$ and $X \setminus A$ (as $A$ is open, being the preimage of an open set under a continuous function).

*So it suffices to check that $\tilde g|_{\operatorname{cls} A} = g|_{\operatorname{cls} A}$, that is $g|_{∂A} = 0$.

*Since $X$ is metrizable, so is $\operatorname{cls} A$. As $A ⊆ \operatorname{cls} A$ is dense, every point $x ∈ ∂A$ is the limit of a sequence in $A$. Note that $∂A ⊆ X \setminus A$, as $A$ is open in $X$, and so $g|_{∂A} ≥ 0$.

A: Hint: $g$ is continuous, which intuitively means that is supposed to map close points close to each other. Formally this means that we obtain a $\delta$ such that [yadda yadda]. 
Notice that $\widetilde g$ maps close points either (1) equally close together or (2) closer together [if, say, g(point) is negative and g(other) is positive]. This gives us a strong guess as to a $\widetilde\delta$ that will work.
