Formalizing this may take a bit of work but:
When you find the decimal expansion of $n$ you start by dividing $n$ into $10$ and taking the remainder. You then take the remainder and multiply it by $10$. ANd you divide $n$ to that and take the remainder and repeat. And you do this an infinite number of times.
Now three things:
1) If you have get a remainder of $0$ then everything ends and this is a terminating decimal. A terminating decimal is actually one with an infinite number of zeros. This has a period of $1 = 2- 1\le n-1$.
2) If you ever reach a point were you get a remainder that you had already gotten before, then when you multiply by $10$ you we get the same thing you got before and when you divide $n$ into it the next remainder you get this time, will be the same as the next remainder you got last time. And so on. So if you ever get the same remainder twice then from that point on everything will repeat in a period pattern.
(When you formally write this up, you can refer to this as the Principle of Induction)
3) You WILL reach a point were you get a remainder that you had already gotten before.
If you never get $0$ as a remainder there are only $n-1$ possible remainders you can ever get. So within $n-1$ steps you will repeat a remainder. (Formally we can call that the Pigeon Hole Principal.)
And so the period will repeat within $n-1$ steps and the period can be at most $n-1$.
Now, write that up in formal terms.
(The most tedious part that I personally hate is describing the process of $10r_k = d_{k+1}n + r_{k+1}$ to describe taking $10$ times the remainder you got in the $k$th step, dividing it by $n$ to get $d_{k+1}$, the $k+1$th decimal, and $r_{k+1}$ then $k+1$th remainder. But even though it is tedious it is straitforward.)