Given $f: \mathbb{R} \to \mathbb{R}$ and
\begin{align\*}
f(x) = 
\begin{cases} 
x^2 & \text{if}\; x \not= 0 \\
-1 &\text{if}\; x = 0
\end{cases}
\end{align\*}
Please help me prove it follows this definition.
$f$ is lower semi-continuous iff $f^{-1} ((-\infty,M]):=\{ x \in \mathbb{R}: f(x) \leq M \}$ is closed.
I want to show $f^{-1} ((-\infty,0])$ is closed, then f is lower semi continuous.