Discussion: This is a good example of a problem solved using the principle of invariance: look for what changes and what stays the same when some transformation is performed. Here the student observes that when all the x_i are +1 the value is n. On the other hand, whatever the assignment of the x_i, when the sign of one is changed the change in the sum is either 0, +4, or -4. Since the original sum is zero and it can be transformed to n by a sequence of sign changes in the variables and at each step either 0, +4 or -4 is added, it means that n must be a multiple of 4.

Written response: Good use of invariance to prove this.