Here's a proof in the opposite direction: Every positive rational number has either a terminating or repeating decimal expansion, and the positive rational numbers $\frac{p}{q}$ (in lowest terms) which have a finite expansion are precisely where $q$ has the form $2^{a}5^{b}$ with $a,b$ non-negative integers.

If $q$ has the form $2^{a}5^{b},$ then $10^{\max(a,b)}\frac{p}{q}$ is an integer, so the decimal expansion of $\frac{p}{q}$ terminates. If $q$ does not have that form then there is no positive integer $n$ such that $10^{n}\frac{p}{q}$ is an integer, so the decimal expansion does not terminate.

It is possible to predict the length of the repeating part of the decimal expansion of $\frac{1}{q}.$ I'll do it in detail in the case that ${\rm gcd}(q,10) = 1,$ the general case follows easily. Note that $10$ is then a multiplicative unit in the ring $\mathbb{Z}/q\mathbb{Z}.$ The order of $10,$ say $d,$ is then a divisor of $\phi(q),$ where $\phi$ is Euler's function ( the number of positive integers less than $q$ which are coprime to $q$). The integer $d$ satisfies $q| (10^{d}-1)$ and $q \not | (10^{e}-1)$ for $0 < e <d.$ It follows easily that the repeating part of the decimal expansion for $\frac{1}{q}$ has length $d,$ which is a divisor of $\phi(q).$

It is quite interesting trying to find primes $q$ for which the maximal possible length $q-1$ is achieved. The smallest such prime is $q = 7.$ Using quadratic reciprocity, it can be checked that $10$ is a quadratic residue (mod $q$) for $q \equiv 1,9,-1,-9, 13,-13,3,-3$ (mod $40$), so for those primes the repeating part of the decimal expansion of $\frac{1}{q}$ has length dividing $\frac{q-1}{2},$ and can't be the maximal $q-1.$

For example, when $q = 13,$ we find that $\frac{1}{13} = 0.\overline{076923}$, and the repeating part has length $ 6 = \frac{13-1}{2}.$ However, when $q = 17,$ the repeating part of the decimal expansion of $\frac{1}{17}$ has length $16 = q-1.$