a) For example, take
Q(x)=(x1+x2−x3−x4)2+(x1−x2+x3−x4)2+(x1−x2−x3+x4)2+02.
b) Consider the representation from the problem conditions:
4(x12+x22+x32+x42)−(x1+x2+x3+x4)2=P12+P22+P32+P42.(1)
The equalities 0=Q(0,0,0,0)=P1(0,0,0,0)2+⋯+P4(0,0,0,0)2 imply that the constant terms of polynomials P1,P2,P3 and P4 are zeroes. First we will show that all these polynomials are linear (i.e. of a degree not exceeding 1).
Consider the monomial order and let x1α1x2α2x3α3x4α4 be the leading monomial over P1,P2,P3 and P4. The sum P12+P22+P32+P42 contains monomials x12α1x22α2x32α3x42α4 only with positive coefficients, since they cannot be products of two distinct monomials of Pi. Hence such monomial belongs to Q, but the leading monomial of Q is 3x12. Therefore, the leading monomial equals x1, i.e. any term, divisible by x1, equals ax1 for some integer a. Since we can arrange the variables in the definition of the order arbitrary, similar statement is true for all variables. Thus, polynomials P1,P2,P3 and P4 are indeed linear.
Denote Pi=ai1x1+ai2x2+ai3x3+ai4x4, i=1,2,3,4. Substitute the values (1,0,0,0) of variables to (1), we obtain the equality a112+a212+a312+a412=3, hence all these coefficients equal 0 or ±1. Substitutions (0,1,0,0), (0,0,1,0) and (0,0,0,1) lead to similar conditions on the coefficients at x2,x3 and x4. Wherein, among aij there are exactly 12 nonzero coefficients. Since Q(1,1,1,1)=0, all Pi(1,1,1,1)=0, therefore each Pi contains 4, 2 or 0 nonzero coefficients.
The number 12 can be represented as a sum of four integers, which equal to 4, 2 or 0, in two ways: 12=4+4+4+0 and 4+4+2+2. Suppose that all Pi are nonconstant polynomials. Then, without loss of generality, let P1 and P2 have 4 nonzero coefficients each, and P3 and P4 have 2 nonzero coefficients each. By rearranging the variables (if necessary) we can make P1(1,1,1,1)=x1+x2−x3−x4.
Consider the equality
0=Q(1,1,0,0)−P1(1,1,0,0)2=P2(1,1,0,0)2+P3(1,1,0,0)2+P4(1,1,0,0)2.
Hence Pi(1,1,0,0)=Pi(1,1,1,1)=0 for i≥2. These equalities implies that the coefficients at x1 and x2 has different sign in P2 as well as the coefficients at x3 and x4. By rearranging (if necessary) x1 with x2, and x3 with x4, we can make P2=x1−x2+x3−x4.
Consider similar equality
0=Q(1,0,1,0)−P1(1,0,1,0)2−P2(1,0,1,0)2=P3(1,0,1,0)2+P4(1,0,1,0)2.
It implies P4(1,0,1,0)=P3(1,0,1,0)=0. Recall that P3(1,1,0,0)=P3(1,1,1,1)=0.
The last three equalities can be written as
a31+a32=0,a31+a33=0,a31+a32+a33+a34=0.
Whence a32=a33, a31=a34 and a32=−a31. Therefore, either all coefficients of P3 are zeroes or none of them are zeroes. But P3 has exactly two nonzero coefficients — a contradiction. So, at least one of P1,P2,P3 and P4 is constant.