The idea is the same as in the previous problem. When you are performing the four basic arithmetic operations and take the remainder modulo some q, you can take the remainder at any time; the result will be the same. Let us denote by (x mod q) the remainder of x when divided by q. Then

(x * y) mod q =

((x mod q) * (y mod q)) mod q =

((x mod q) * y) mod q =

(x * (y mod q)) mod q

That is, you can take the remainder either before or after the operation.

Therefore, to find (n^3 - n) mod 6, it is sufficient to find ((n mod 6)^3 - (n mod 6)) mod 6, and there are only 6 possible values for n mod 6.

Edit: Questions about modular arithmetic should go to the Number Theory forum.