Suppose that $n \in \mathbb{N}$ and that $2 \leq a \leq n-2.$ I want to show that if $a^3 \equiv a$ (mod $n$), then $n$ is composite.
Well, $n$ being composite means that there are other factors (apart from $1$ and itself) that, when multiplied together, yield $n$. I'm trying to wrap my head around this problem, but cannot seem to get anywhere. Since we are showing $n$ is composite, perhaps Fermat's Little Theorem will not be useful here, but, instead, maybe there needs to be a direct application of Euler's Theorem. Comments and suggestions are welcome.
You know that $n\mid a(a-1)(a+1)$. If $n$ is prime, then $n\mid a-1$ or $n\mid a$ or $n\mid a+1$. That's not possible, since $a\leqslant n-2$.