Folland Real Analysis Chapter 4 Exercise 15 I'm studying for a test (and prelims) and have been working through Folland. I've been a bit stuck on the following problem. $\overline{A}$ denotes the closure of $A$, $A^o$ the interior, and $g\in C(A)$ means $g$ is continuous on $A$.
If $X$ is a topological space, $A\subset X$ is closed, and $g\in C(A)$ satisfies $g=0$ on $\overline{A}\setminus A^o$, then the extension of $g$ to $X$ defined by $g(x)=0$ for $x\in A^c$ is continuous.
I know that if $A$ is closed then $A^c$ is open, and that $\overline{A}=A$. Also, $(\overline{A}\setminus A^o)^c=A^o\cup A^c$. To show that $g$ is continuous on $A^c$, I need to show for any neighborhood $V$ of $g(x)$ that $g^{-1}(V)$ is a neighborhood of $x$.
I know I should start with an arbitrary $x\in A^c$ and an arbitrary neighborhood $V$ of $g(x)$, however I am not sure how to proceed. Any ideas?
 A: 
Let $X$ and $Y$ be two topologies.
Definition. For $x\in X$, $f\colon X\to Y$ is called continuous at $x$ if for each open set $V$ in $Y$ containing $f(x)$, there is an open set $U$ in $X$ containing $x$ such that $f(U)\subset V$.
Theorem. $f\colon X\to Y$ is continuous if and only if for every $x\in X$, $f$ is continuous at $x$.
Elementary books on general topology contains a proof, or leave it as an exercise.

Now let us prove your problem. By the theorem above, it suffices to show that $g$ is continuous at $x$ for all $x\in A^c$. Let $x\in A^c$ and let $V$ be an open set containing $g(x)=0$. Since $A$ is closed, $A^c$ is open (as you mentioned), and $A^c\subset g^{-1}(0)$ (as your definition of extension of $g$ on $A^c$) so that $g(A^c)\subset g(g^{-1}(0))\subset V$ since $V$ contains $g(x)=0$.
A: For $x\in A^\circ$, pick $V$ to be an open neighbor of $g(x)$. Then by continuity of $g$, we can find $U\subset A$ open in $A$ such that $g(U)\subset V$. Then $x\in U\cap A^\circ$ with $g(U\cap A^\circ)\subset V$ where $U\cap A^\circ$ is open in $X$.
For $x\in A-A^\circ$, we have $g(x)=0$. Let $V$ be an open neighbor of $g(x)=0$, by continuity of $g$ on $A$, we can find $U\subset X$ open in $X$ such that $g(U\cap A)\subset V$ and $x\in U\cap A$. Note that $g(U\cap A^c)=\{0\}\subset V$, then we have $g(U)\subset V$ where $x\in U$ and $U$ is open in $X$. 
The case for $x\in A^\circ$ is given in the previous answer. 
