Rephrasing the question, it is asking to find the number of solutions to $n|x(x+1)(x-1)$
What I have so far is that if $n$ is prime then the solutions are $x = 0, 1, n-1$, and for $n$ is composite I think I first need to find the number of solutions for when $n$ is a prime power and use the CRT to deduce the final solution. I'm stuck on trying to deduce the number of solutions for when $n$ is a prime power, any hints on how to approach it?