We need to prove that for all integer n not multiples of 7: n3=7m±1 where m is an integer. (If n is a multiple of 7 then the remainder has to be zero of course.)
This means that all such n3 leave a remainder of 1 or -1 when divided by 7. The remainder -1 is the same as -1+7=6. So n3±1=7m. We need to prove that (n3+1)(n3-1)=n6-1 is divisible by 7, implying that 7 goes into one or the other factor.
We only need to consider the 6th powers of 1, 2, and 3, that is, 1, 64 and 729, because 4=7-3, 5=7-2, 6=7-1. If we raise 7-3, 7-2 and 7-1 to the 6th power as an expansion, every term except the last contains the factor 7, so all the terms in the expansion apart from the last is divisible by 7. The last term is 3, 2 or 1 raised to the 6th power. Furthermore, since all integers can be expressed as 7m+x, where x ranges from 1 to 6, the 6th power of these integers, when (7m+x)6 is expanded, has a last term which is x6, all other terms being divisible by 7.
26-1=63 and 36-1=728, both divisible by 7. 16=1 so 1-1=0 which is a multiple of 7. We have covered all possible integers now so we have proved that the cube of all integers divided by 7 leaves a remainder of 1 or 6.