Prove that every subset of a metric space $M$ can be written as the intersection of open sets.
My attempt:
If $A\subset M$ is open, $A$ can be written as $A\cap M$, which is the intersection of 2 open sets.
If $A\subset M$ is closed, it can presumably be written as the intersection of infinitely many open sets. But I'm not sure how.
And what if $A\subset M$ is neither open nor closed?
Every singleton is closed in a metric space. That's all we need. (Simple proof of this fact, for any $p \in X$: $$X \setminus \{p\} = \bigcup \{B(q, d(p,q)): q \neq p\}$$ showing its complement is a union of open balls, hence open.)
Then observe that $$A = \bigcap \{X\setminus \{p\}: p \notin A\}$$
is an intersection of open sets for any $A \subseteq X$.