I have a problem I have been very stuck on.
Show that if $p \nmid n$, then the length of the period [of the expansion of $\frac{a}{n} \in \mathbb Q$] divides $e$, where $e$ is the least positive integer such that $p^e \equiv 1 \pmod n$.
I went to my professor for a hint, and his hint was to write $\frac{a}{n}$ as $$\frac{a k}{p^e - 1},$$ for some $k \in \mathbb Z$, then multiply both sides of the $p$-adic expansion $$\frac{a}{n} = \sum_{i = 0}^\infty q_i p^i$$ by $p^e - 1$ and group common powers of $p$. Thus, if $a k < 0$ (I imagine there is a similar argument for $a k \geq 0$ if I can make this one work), $$-a k = \sum_{i = 0}^{e - 1}q_i p^i + \sum_{i = e}^\infty (q_i - q_{i - e}) p^i,$$ and so if $q_i \geq q_{i - e}$ for all $i \geq e$, then this is the $p$-adic expansion of the non-negative integer $-a k$, which we know to be finite. Thus, $q_i = q_{i - e}$ for sufficiently large $i$, and I'm pretty sure I can show that the period divides $e$ from there. However, I can't figure out the details if there are any $i \geq e$ such that $q_i < q_{i - e}$.
Sorry for abandoning this question for a while, but the semester was keeping me busy. My professor eventually answered the question during an exam review, so I'm going to share his answer, which ended up being similar to reuns's and not using the hint he gave (apparently the source he got the problem from had a mistake which made the problem seem easier than it was).
First, we prove the result for $\frac{b}{n} \in [-1, 0)$. Let $$B = \frac{b (1 - p^e)}{n} \in \mathbb Z$$ and note that $0 < B \leq p^e - 1$. The $p$-adic expansion of $B$ is then $$B = \sum_{k = 0}^{e - 1}B_k p^k,$$ and so the $p$-adic expandsion of $\frac{b}{n}$ is $$\frac{b}{n} = \frac{B}{1 - p^e} = \sum_{j = 0}^\infty\sum_{k = 0}^{e - 1}B_k p^{k - j e},$$ which is periodic with period $e$.
Then, with $S_e$ as defined in reuns's answer, we show that if $x \in S_e$, then $x + m \in S_e$ for any $m \in \mathbb Z$. To show this, we show that if $x \in S_e$, then $x + 1, x - 1 \in S_e$, which we in turn show by showing that if $x \in S_e$, then $-x, -1 - x \in S_e$. Suppose $x \in S_e$ and the $p$-adic expansion of $x$ is $$x = \sum_{k = d}^\infty x_k p^k, \text{ with } x_d \neq 0.$$ Then \begin{align} -x &= p^d + (-1) p^d - x\\ &= p^d + \sum_{k = d}^\infty(p - 1) p^k - \sum_{k = d}^\infty x_k p^k\\ &= (p - x_d) p^d + \sum_{k = d + 1}^\infty(p - 1 - x_k) p^k\\ &\in S_e \end{align} and $$-1 - x = \sum_{k = 0}^{d - 1}(p - 1) p^k + \sum_{k = d}^\infty(p - 1 - x_k) p^k \in S_e$$ since $p - x_d, p - 1 - x_k \in \{0, \ldots, p - 1\}$ for all $k \geq d + 1$.
Finally, since $\frac{a}{n} = m + \frac{b}{n}$ for some $m \in \mathbb Z$ and some $\frac{b}{n} \in [-1, 0)$, this completes the proof.