I've heard this fact numerous times in the past but I've never fully understood its proof. So I'm hoping to do it right this time:
Take the usual topology on $\mathbb{R}$ and take the subspace topology for $\mathbb{Q}$.
To prove that $\mathbb{Q}$ is dense in $\mathbb{R}$ it suffices to show that $\mathbb{R}\subseteq\overline{\mathbb{Q}}$.
The closure of $\mathbb{Q}$ can be written as $\overline{\mathbb{Q}}=\{x\in\mathbb{R}\mid \text{ if } x\in (a,b) \text{ then }(a,b) \cap \mathbb{Q} \neq \emptyset\}$
Let $x\in\mathbb{R}$, and let $(a,b)$ be an arbitrary open interval in $\mathbb{R}$ containing $x$. It suffices to show that there exist $p\in\mathbb{Q}$ such that $p\in (a,b)\cap\mathbb{Q}$, or equivalently, $a<p<b$.
How can I proceed from here?
There is some confusion here. You don't need to consider the subspace topology on $\mathbb Q$. You only need to see $\mathbb Q$ as a subset of $\mathbb R$. And $\mathbb R\subset\overline{\mathbb Q}$ looks weird; here, the whole universe is $\mathbb R$ and therefore what you want to prove is that $\mathbb R=\overline{\mathbb Q}$.
Now, if $a,b\in\mathbb R$ with $a<b$, just consider the sequence $\left(2^{-n}\left\lfloor2^{n-1}(a+b)\right\rfloor\right)_{n\in\mathbb N}$, which is a sequence of rational numbers smaller than or equal to $\frac{a+b}2$ which converges to $\frac{a+b}2$. Therefore, if $n$ is big enough, $2^{-n}\left\lfloor2^{n-1}(a+b)\right\rfloor\in(a,b)$.