Let $U$ be a topological space and a map $g:U\to \mathbb{R}$. For a given $r\in\mathbb{R}$, define $E:= \{x\in U: g(x)\leq r\}$. If $g$ is continuous at every point of $E$, then Is it true that $E$ is closed set in U? If yes, prove it. If not, give counter example. 

My guess is yes.. Here is my attempt. Let $x\_n\in E$ be a sequence such that $\lim\_{n\to\infty}x\_n = x$. I am trying to prove $x\in E$. By continuity of $g$, we have $g(x\_n)$ also converges. Moreover, $g(x\_n)\leq r$ for all $n$. Therefore, $\lim\_{n\to\infty}g(x\_n)\leq r$.

Here I am stuck. If I prove that $\lim\_{n\to\infty}g(x\_n)=g(x)$, I am done. Can somebody help me here.