Is $\{x \in \mathbb{R}^n: f(x) < 0\}$ open? For a function $f: \mathbb{R}^n \to \mathbb{R}$, I was wondering 


*

*Is $\{x \in \mathbb{R}^n: f(x) < 0\}$  open?
If not, what are some sufficient and/or  necessary conditions for it
to be open?

*Is $\{x \in \mathbb{R}^n: f(x) = 0\}$  closed?
If not, what are some sufficient and/or  necessary conditions for it
to be closed?

*Is $\{x \in \mathbb{R}^n: f(x) \leq 0\}$  closed?
If not, what are some sufficient and/or  necessary conditions for it
to be closed?

*I feel $\{(x,y) \in \mathbb{R}^2: -x+\sqrt{y} < c \}$
for some $c \in \mathbb{R}$ is open. To prove it, I want to show
that  for every point in it, it has an open ball centered at it and
the ball is contained inside the subset. This is however not obvious
for me to show.


Thanks and regards!
 A: In general there is no such reasonable conditions. For cases (1)-(3) consider functions
$$
f_1(x)=\begin{cases}1\qquad x\neq(0,\ldots,0)\\-1\qquad x=(0,\ldots,0)\end{cases}
$$
$$
f_2(x)=\begin{cases}0\qquad x\neq(0,\ldots,0)\\1\qquad x=(0,\ldots,0)\end{cases}
$$
$$
f_3(x)=\begin{cases}0\qquad x\neq(0,\ldots,0)\\1\qquad x=(0,\ldots,0)\end{cases}
$$
respectively. In this cases the set
$$
\{x\in\mathbb{R}^n:f_1(x)<0\}=\{(0,\ldots,0)\}
$$
is not open, the set
$$
\{x\in\mathbb{R}^n:f_2(x)=0\}=\{x\in\mathbb{R}^n:x\neq(0,\ldots,0)\}
$$
is not closed and the set
$$
\{x\in\mathbb{R}^n:f_3(x)\leq 0\}=\{x\in\mathbb{R}^n:x\neq(0,\ldots,0)\}
$$
is not closed also.
But if require $f$ to be continuous then all these statements will be true. In fact the following general result holds.
Theorem. Let $X$, $Y$ be metric spaces and $f:X\to Y$ map between them, then conditions


*

*$f$ is continuous

*for each open set $U\subset Y$ the set $f^{-1}(U)\subset X$ is open

*for each closed set $F\subset Y$ the set $f^{-1}(F)\subset X$ is closed
are equivalent.
Now you can apply this result to the continuous function 
$$
f(x,y)=-\sqrt{x}+y
$$
where $X=\mathbb{R}_+\times\mathbb{R}$, $Y=\mathbb{R}$ and $U=(-\infty,c)$.
