I was thinking a little more about this question you have asked, and I was thinking it is probably more useful for you to prove essentially that this modulo reduction operation is a homomorphism under addition.

You probably have not gotten to this yet in your book, but the concept of a homomorphism will be important, so you might as well start to think about it now.

Consider the function

(mod n).

Now what you need to show is that it doesn't make a difference if you add two integers before you apply

or after you apply

to them separately. In symbols I mean:

Simply apply the division algorithm to x and y to see that

(mod n)

(mod n)

So now if you think about your question, associativity of addition under modular addition follows from the fact that addition is associative in

and since this reduction mod n preserves addition, the associativity is inherited from