Let $(X,d)$ be a separable metric space and let $Y \subset X$ be its countable dense subset.
Take the basis to be
$$\mathcal{B}=\{B_{\frac{1}{n}}(x): x \in Y, n \in \Bbb{Z}^+\}$$
I claim for an arbitrary open subset $U \subset X$ that $B_{\frac{1}{n}}(x) \subset U$. Then $\mathcal{B}$ is a basis for the topology on $X$.
To see this, let $y \in U \in \tau$ where $\tau$ is the topology on $X$. As $U \in \tau$, there exists some $\epsilon >0$ such that
$$B_\epsilon(y) \subset U.$$
But there also exists some $ n \in \Bbb{Z}^+$ such that $n > \frac{2}{\epsilon}$ then $\epsilon > \frac{2}{n}$. I.e.,
$$B_{\frac{2}{n}}(y) \subset B_\epsilon(y) \subset U \space (*). $$
As $Y$ is dense in $X$ there exists an $x$ such that
$$x \in Y \cap B_{\frac{1}{n}}(y).$$
That is, $y \in B_{\frac{1}{n}}(x)$. Then for all $z \in B_{\frac{1}{n}}(x)$ one has
\begin{align} d(y,z) &\le d(y,x)+d(z,x)\\ &<\frac{1}{n}+\frac{1}{n}\\ &=\frac{2}{n}. \end{align}
That is,
$$B_{\frac{1}{n}}(x) \subset B_{\frac{2}{n}}(y)$$
Then we are done by $(*)$ as an element of $\mathcal{B}$ is contained in some arbitrary element of $\tau$?. Does this work? I got this wrong on my final and I'm preparing for a qualifying exam in the subject and want to make sure I understand the proofs I write correctly. Thanks in advance. I know there are similar posts but I found this argument to make sense to me better. I wanna make sure I got all my reasoning correct mainly.
You need to change the "I claim ..." sentence to reflect what you actually prove: "I claim that for an arbitrary open set $U\subseteq X$ and a point $y\in U$ there are $x\in Y$ and $n\in\mathbb{Z}^+$ such that $y\in B_{\frac1n}(x)\subseteq U$."
The proof is correct.