The Problem
A subset $D$ of a metric space $X$ is dense if its closure is all of $X$: $\operatorname{cl}(D) = X$. Equivalently, every nonempty open ball contains a point of $D$. Show that $\mathbb{Q}$ is dense in $\mathbb{R}$ — that is, for every real $x$ and every $\varepsilon \gt 0$ there is a rational $q$ with $|x - q| \lt \varepsilon$, so $\operatorname{cl}(\mathbb{Q}) = \mathbb{R}$.
Definition. $D$ is dense in $X$ when $\operatorname{cl}(D) = X$: for every $x \in X$ and every $\varepsilon \gt 0$ there is $a \in D$ with $|x - a| \lt \varepsilon$.
State what "dense" means
Goal. Fix an arbitrary $x \in \mathbb{R}$ and $\varepsilon \gt 0$. We must produce a rational $q$ with $|x - q| \lt \varepsilon$.
Fix $x$ and $\varepsilon$; name the target
By the
Archimedean property, choose $n \in \mathbb{N}$ with $\dfrac{1}{n} \lt \varepsilon$.
So the spacing $1/n$ is finer than the precision we were asked for.
Use the Archimedean property to pick $n$
Let $S = \{\,k \in \mathbb{Z} : k \gt nx\,\}$. It is nonempty (Archimedean again) and bounded below, so it has a least element $m$.
Find the least integer $m \gt nx$
Because $m$ is the least such integer, $m - 1 \le nx \lt m$. Set $q = \dfrac{m}{n} \in \mathbb{Q}$.
$$\frac{m-1}{n} \le x \lt \frac{m}{n} = q$$
Build the rational $q = m/n$ that brackets $x$
Then $0 \lt q - x = \dfrac{m}{n} - x \le \dfrac{m - (m-1)}{n} = \dfrac{1}{n} \lt \varepsilon$.
$$|x - q| \lt \frac{1}{n} \lt \varepsilon$$
Estimate the distance $|x - q|$
Conclusion. $q \in \mathbb{Q}$ lies within $\varepsilon$ of $x$. Since $x$ and $\varepsilon$ were arbitrary, $\operatorname{cl}(\mathbb{Q}) = \mathbb{R}$ — $\mathbb{Q}$ is dense in $\mathbb{R}$. $\blacksquare$
Final answer
Key Takeaways
Nicely done — you built a rational inside any window around a real, which is exactly density.
- Dense means approximable: for any real $x$ and any precision $\varepsilon \gt 0$, some rational sits within $\varepsilon$ of $x$, so $\operatorname{cl}(\mathbb{Q}) = \mathbb{R}$.
- The Archimedean property is the engine: it lets us pick $n$ with $\tfrac{1}{n} \lt \varepsilon$, making the grid $\{m/n\}$ as fine as needed.
- Construction, not magic: the least integer $m \gt nx$ gives $q = m/n$ with $m-1 \le nx \lt m$, forcing $|x - q| \lt \tfrac{1}{n} \lt \varepsilon$.
- Between any two reals lies a rational (and an irrational) — the same idea shows the irrationals and the dyadic rationals are dense in $\mathbb{R}$ too.
- Why it matters: a continuous function is determined by its values on a dense set, and (Weierstrass) the polynomials are dense in $C[a,b]$.
Even though $\mathbb{Q}$ is countable and $\mathbb{R}$ is not, the rationals are "everywhere" in the reals.