# Prove least upper bound for piecewise inequality

Say $S = \left\{ x \in \mathbb{Q} \mid 0 < x < 1 \textrm{ or } 3 < x < 4 \textrm{ or } 6 < x < 8 \right\}$. I want to show that the least upper bound of this set is $8$, but I don't know how to rigorously prove this because it seems obvious that all $x \in S$ is $x < 8$, and this is a strict inequality since $x \in \mathbb{Q}$. So since there are no other rationals in $S$ greater than $8$, $8$ seems to be the least upper bound.

Let $\varepsilon>0$. Notice that $S=[(0,1)\cup(3,4)\cup (6,8)]\cap\mathbb{Q}$. Then by the density of $\mathbb{Q}$ you are able to find a $y_\varepsilon \in S$ such that $$8- \varepsilon< y_\varepsilon<8$$ So you can conclude that $8=\sup S$.
Let $C\subset \Bbb R$ then by definition:
$m = \sup C$ $\iff$ $y \leq m, \forall y \in C$ and $\forall\epsilon > 0, \exists x \in C$ such that $|m-x| \leq \epsilon$.