Let $f$ be the map from $\mathbb{R} \to \{a,b,c\}$ defined by \begin{equation} f(x)=\begin{cases} a &\text{if} \quad x>0 \\ b & \text{if} \quad x<0 \\ c &\text{if} \quad x=0 \end{cases} \end{equation} Determine pre-images $f^{-1}(B)$ of all subsets of $B$ and justify if they are closed, open or neither.
My reasoning
Let $f$ be a function from $X$ to $Y$. The pre-image of the set $B \subseteq Y$ under $f$ is the subset of $X$ defined by \begin{equation} f^{-1}[B]=\{x \in X:f(x) \in B\} \end{equation}
As such, I would answer $f^{-1}(a)=\mathbb{R}^{+}\backslash \{0\}, f^{-1}(b)=\mathbb{R}^{-1}\backslash \{0\},f^{-1}(c)=0$. As for the second part, I would argue the two first cases are open, as every point in these two subsets are interior point in their respective subset. As for the last case, I interpret the corollary to theorem 2.20 (Rudin, p.33) - A finite point set has no limit points - that it is neither open nor closed. Is any of this correct?
Your reasoning for the first part is correct. Both $f^{-1}(a)$ and $f^{-1}(b)$ are open.
Concerning $f^{-1}(c)$, here is a hint:
What is the complement of $f^{-1}(c)$? Recall that a set is closed if its complement is open.
One way to reconcile this reasoning with the material in Rudin is by asking yourself (carefully) if every limit point of $f^{-1}(c)$ in $f^{-1}(c)$. If this were not true, then by negating quantifiers, the statement "there exists a limit point of $f^{-1}(c)$ not in $f^{-1}(c)$" would hold. Obviously this is false, since the set of limit points of $f^{-1}(c)$ is empty. Therefore the statement must be true.