For a continuous function $f:\mathbb{R} \rightarrow \mathbb{R}$,let $Z(f)=\{x\in \mathbb{R}:f(x)=0 \}$. Then which of the following is true for $Z(f)$
$Z(f)$ is always open.
$Z(f)$ is always closed.
$Z(f)$ is always connected.
$Z(f)$ is always compact.
If we take as an examples of polynomials in one variable then they are continuous functions on $\mathbb{R}$.In that case set of roots of the polynomials will $Z(f)$. But how to identify whether they are closed,open,compact or connected?
$Z(f) = f^{-1} (0)$ so if $f$ is a continuous function, i.e. the inverse image of open/closed subsets go to open/closed subsets, then it's clear that $Z(f)$ is closed.
If $Z(f)$ were also open, then we'd be in the case of a subset which is both open and closed. In the standard topology of $\mathbf{R}$, this happens if and only if the space is trivial. Thus, just pick any function that has zeros, but is not identically zero.
Connectedness is easy because for "nice" functions, such as polynomials, their zeros are isolated. Thus, for this class of function, we just need to pick one that has (at least) two distinct zeros. Take $f(x) = x (x-1)$ for example. Then $Z(f) = \{0\} \cup \{1\}$ is not connected.
Functions whose inverse image of compact subsets are compact have a special name, namely they are proper functions. This gives reason to believe that maybe $Z(f)$ won't be compact. By the Heine-Borel Theorem, compact subsets are equivalent to closed and bounded subsets. So we know it's already closed, then we should try to construct an example to violate boundedness. This can be achieved by considering a function such as $f(x) = \sin (x)$. The zeros are $2 \pi k$, where $k \in \mathbf{Z}$ so it is clearly not bounded.