I have the following set in $\mathbb{R}^2$:
$$ S=\{(x_1,x_2)\in\mathbb{R}^2 : f(x_2)<0\} \neq \varnothing $$ for some continuous function $f\colon\mathbb{R}\to\mathbb{R}$. Can we say that the closure of $S$ is given by $$ \overline S=\{(x_1,x_2)\in\mathbb{R}^2 : f(x_2)\leq 0\} $$ Please help me as I am new to set theory...
(This answer addresses the original question.)
As @TPace suggests, if $f$ admits a point of discontinuity, then it's not necessarily true.
Consider the function $f(x) = \begin{cases} -1 & x < 0 \\ 1 & x \ge 0\end{cases}$. Since $0$ is not in the range of $f$, $f(x) < 0$ is equivalent to $f(x) \le 0$. Can you continue?