Proving that $\Bbb Q$ is dense in $\Bbb R$ I would like a hint for the following:
$\forall \epsilon >0$ $\forall x\in \mathbb{R}$ $\exists y \in \mathbb{Q}$ $:$ $|x-y|< \epsilon$.
The idea I have is to break it into the following cases:
(1) x $< \epsilon$
(2) $x > \epsilon$
(3) x= $\epsilon$
Is there a simpler way to do this?
I'd love a hint.
 A: Since you have the theorem that for any two real numbers $a,b$ with $a < b$, there is a rational number in the interval $(a,b)$, we can argue as follows . . .

Let $\epsilon > 0$, and let $x\in\mathbb{R}$.

Let $y$ be a rational number in the interval $(x-\epsilon,x+\epsilon)$.
\begin{align*}
&y\in (x-\epsilon,x+\epsilon)\\[4pt]
\implies\;&x-\epsilon < y < x+\epsilon\\[4pt]
\implies\;&-\epsilon < y-x < \epsilon\\[4pt]
\implies\;&|y-x| < \epsilon\\[4pt]
\implies\;&|x-y| < \epsilon\\[4pt]
\end{align*}
as required.
A: You can take a number $q \geq 1 $ and subdivide $\mathbb{R}$ in intervals of length $1/q$, so you have $\mathbb{R} = \cup_{i \in \mathbb{Z}} [i/q,(i+1)/q[$, since this union is disjoint then $\exists! i \in \mathbb{Z}$ such that $x \in [i/q,(i+1)/q[$, and since the lenght of the interval is $1/q$ then $|x-i/q| \leq 1/q$, if you take $q$ large enough then $ 1/q < \epsilon$, and $y = i/q$ solves the problem.
A: Hint: write $x$ in the decimal form, and take its first $n$ terms as $y$, where $n$ is an integer such that $10^{-n}<\epsilon$.
