# Prove $M$ has a countable open base if, and only if, $M$ is separable

I'm in my first analysis class and I'm pretty confused about what direction to take this question. The definitions I'm working with are:

Open Base: $$(U_{\alpha})$$ is an open base of M if every open subset of $$M$$ can be written as the union of $$U_{\alpha}$$.

Dense: A set $$A$$ is dense in $$M$$ if if $$\bar{A}=M$$ $$\iff$$ $$\forall x\in M, \forall\varepsilon>0,$$ $$B_{\varepsilon}(x)\cap A\not=\phi$$

Separable: A metric space $$M$$ is separable if it contains a countable dense subset.

I got a hit that we should consider $$\{x_n\}$$ a countable dense subset in $$M$$ and the collection of balls with rational radii centered at $$x_n$$, and I how we could potentially use this to construct an open base... but not how to go from an arbitrary open base to separable.

Thanks for any help!

Going from a countable base to separability is actually the easier direction. Let $$\mathscr{B}=\{B_n:n\in\Bbb N\}$$ be a base for $$M$$, and for each $$n\in\Bbb N$$ let $$x_n\in B_n$$. Let $$D=\{x_n:n\in\Bbb N\}$$; now use the fact that $$\mathscr{B}$$ is a base to show that $$D$$ is dense in $$M$$.