Show the iff statement of lower semicontinuous Given $X\subseteq \Bbb R^m, f:X\to\Bbb R$ and $x\in X$, we say $f$ is lower semicontinous (l.s.c for short) at x if$\forall \varepsilon>0\ \exists\ \delta >0\ \forall \in B(\delta,x), \ f(x)\le f(y)+\varepsilon$. 
I wish to show: 
If $X$ is closed, then $f$ is l.s.c if and only if the set $f^{-1}((-\infty,r]):=\{a\in X:f(a)\le r\}$ is closed for each $r\in \Bbb R$. I wonder how I could use the requirement that the set $X$ is closed.
 A: Let's begin with the "if" part: I'm gonna show that if $y_n\rightarrow y$ then $f(y)\leq\liminf f(y_n)$. Let $\epsilon_n=\frac{1}{n}$; by hypothesis, for each $n$ we can find some $\delta_n$ such that $f(y)\leq f(y_n)+\epsilon_n$. Now you take the inferior limit.
To finish, take a sequence $(y_n)\subset f^{-1}((-\infty,r])$ such that $y_n\rightarrow y$. By using what we have just proved, we have that $f(y)\leq\liminf f(y_n)$. Can you conclude?
On the other and, suppose that for all $r$, the set $f^{-1}((-\infty,r])$ is closed and suppose ad absurdum that there exist $\epsilon>0$ such that for all $\delta_n=\frac{1}{n}$, we can find $y_n\in B(\delta_n,x)$ with $$f(y)>f(y_n)+\epsilon$$
The last inequality implies that $y_n\in f^{-1}((-\infty,f(y)-\epsilon])$. Can you use the fact that $f^{-1}((-\infty,r])$ is closed and $y_n\rightarrow y$ to conclude?
Note: The hypothesis of $X$ being closed is unnecessary.
A: First Direction: Suppose that $f$ is l.s.c.  To show that $A_r = \{a\in X:f(a)\le r\}$ is closed, let $\{a_n\}$ be a sequence in $A_r$, converging to $a_\infty$, which we want to show is in $A_r$.  Since $f$ is l.s.c., 
$$
f(a_\infty) \leq \liminf f(a_n) \leq a,
$$
since $a_n \in A_r$.  Therefore, $a_\infty \in A_r$.
Second Direction:  The argument is basically identical.
It's much more convenient to use the equivalent sequential definition of lower semi-continuity
