Suppose that the decimal is $x=a.d_1d_2\ldots d_m\overline{d_{m+1}\dots d_{m+p}}$, where the $d_k$ are digits, $a$ is the integer part of the number, and the vinculum (overline) indicates the repeating part of the decimal. Then
$$10^mx=10^ma+d_1d_2\dots d_m.\overline{d_{m+1}\dots d_{m+p}}\;,\tag{1}$$ and
$$10^{m+p}x=10^{m+p}a+d_1d_2\dots d_md_{m+1}\dots d_{m+p}.\overline{d_{m+1}\dots d_{m+p}}\tag{2}\;.$$
Subtract $(1)$ from $(2)$:
$$10^{m+p}x-10^mx=(10^{m+p}a+d_1d_2\dots d_md_{m+1}\dots d_{m+p})-(10^ma+d_1d_2\dots d_m)\;.\tag{3}$$
The righthand side of $(3)$ is the difference of two integers, so it’s an integer; call it $N$. The lefthand side is $\left(10^{m+p}-10^m\right)x$, so
$$x=\frac{N}{10^{m+p}-10^m}=\frac{N}{10^m(10^p-1)}\;,$$
a quotient of two integers.
Example: $x=2.34\overline{567}$. Then $100x=234.\overline{567}$ and $100000x=234567.\overline{567}$, so
$$99900x=100000x-100x=234567-234=234333\;,$$ and
$$x=\frac{234333}{99900}=\frac{26037}{11100}\;.$$
Using the decimal expansion for this purpose is at least cumbersome, and while we can do it by observing that $a$ and $b$ must differ at some decimal for the first time, one has to be careful with lots of $9$s and $0$s causing trouble.
Anyway you have a lot of freedon with "late" decimals, so you can make things periodic or aperiodic at will.
It is much simpler to let $\epsilon=b-a>0$ and then note that there is at least one onteger $n$ with $n>\frac1\epsilon$ and then at least one integer $m$ with $na<m<nb$ (because $nb-na>1$) and one integer $m'$ with $n(a-\sqrt 2)<m'<n(b-\sqrt 2)$. Then $c=\frac mn$ and $d=\frac {m'}n+\sqrt 2$ do the trick.
Best Answer
For example, let $x=0.14141414...$.
Then $100x=14.141414...$, so $100x-x=14,$ so $99x=14$ so $x=14/99$.
In general, if $x=0.\overline {a_1a_2\dots a_n}$, where the overline indicates it's repeated,
then $10^nx=a_1a_2...a_n.\overline{a_1a_2\dots a_n}$, so $10^nx-x=a_1a_2\dots a_n$, so $x=\dfrac{a_1a_2\dots a_n}{10^n-1} $ is rational.