"Exercise 1. Show that if $X$ is equipped with the discrete metric $d$ then every subset of $X$ is both open and closed. Deduce that any function $f : (X, d) → (Y, dY )$ is continuous."
My lecturer shared the following answer:
"Exercise 1. If $A\subset{X}$ then for every $a\in{A}$ we have $B(a, 1/2) = \{a\}$, and so $A$ is open. Since every subset is open, every subset is also closed. The function $f$ is continuous if $f^{-1}(U)$ is open in $(X,d)$ for any open set U in $(Y,dY )$; but $f^{-1}(U)$ is a subset of $(X,d)$, so is always open."
So my question is that are singletons open? I thought they are closed. Or does it depend on the metric?