I hope this is not a duplicate.
Let $E$ be a topological space and $T \subset E$. We say that $T$ is dense in $E$ if every point of $E$ is adherent to $T$, i.e. if $\overline{T} = E$, where $\overline{T}$ is the closure of $T$. In a metric space, precisely in $\mathbb{R}$, I have been given the following definition: $T \subset \mathbb{R}$ is dense in $\mathbb{R}$ if, given two reals $a$ and $b$, $a \lt b$, we can always find $x \in T$ such that $a \lt x \lt b$.
I thought that if $a \lt x \lt b$, then $x$ must be less than $(a+b)/2$ and so, for any $\rho > 0$, $$\frac{a+b}{2} - \rho \leq x \leq \frac{a+b}{2} + \rho$$ In some way I could build a ball centered at $(a+b)/2$, of radius $\rho$, and then conclude that given any real number of the form $(a+b)/2$, we can find a neighborhood (in this case, that ball) cantaining a point of $T$. Obviously, if $x \in \mathbb R$, we can find $b=x$ such that $(x+b)/2 = x$, but must be $a \neq b$.
I don't know if this makes sense. How can I prove it?
If $T$ is dense in the first sense, and $a < b$, then $$\overline T \cap (a,b) = \mathbb R \cap (a,b) = (a,b).$$ In particular $T \cap (a,b) \neq \emptyset$, because the above shows that any point in $(a,b)$ belongs to $\overline T$, and hence that every neighbourhood of any point in $(a,b)$ contains an element of $T$.
Conversely, if $x \in \mathbb R$ is arbitrary, $T$ being dense in the second sense implies that $$T \cap (x-\epsilon, x+\epsilon) \neq \emptyset$$ for any $\epsilon > 0$, whence $\overline T$ contains $x$. Hence $\overline T = \mathbb R$.