Problem. Let $a \geq 2$ and $a \in \mathbb{Z}$. Let $p,q$ be distinct primes. Prove that if $p^2|\frac{a^q-1}{a-1}$, then $a^{p-1} \equiv 1 \pmod {p^2}$.
Attempt. It feels like $p$ gets some property from the condition so that it has the required result. However, I could not figure out what that property is. I played around with Fermat's Little Theorem but got nowhere.
Comment. I'm an undergraduate beginner to number theory, who has only been taught basic things like Euclidean algorithm, Bezout's lemma, Fermat's Little Theorem etc. So, please do not give a hint referring to an advanced theorem. Thank you! Again, hint only please.