1. It is straightforward to verify the following
Lemma. Let x2+bx+c be a trinomial with integer coefficients which is not divisible by 3 for any integer x. Then this trinomial is congruent modulo 3 to one of the next three trinomials: x2+1, x2+x−1 and x2−x−1.
Denote x2+1=p1(x), x2+x−1=p2(x) and x2−x−1=p3(x). The straightforward verification shows that x6+x4+x2+1≡p1(x)⋅p2(x)⋅p3(x)(mod3). Therefore, we can change the polynomial x6+x4+x2+1 in the condition by the polynomial p1(x)p2(x)p3(x).
Let p(x)=ax2+bx+c. We distinguish two cases.
Case 1: p(a)=0. Then there exists a0 such that aa0≡1(mod3). Applying the lemma to a0p(x) we get a0p(x)≡pi(x)(mod3), 1≤i≤3. That is, there exists h0(x) such that a0p(x)=pi(x)−3h0(x). Multiply this equality by pi+1(x)pi+2(x) (where 3+1=2+2=1 and 3+2=2) to obtain a0p(x)pi+1(x)pi+2(x)=p1(x)p2(x)p3(x)−3h0(x)pi+1(x)pi+2(x). It remains to set f(x)=a0pi+1(x)pi+2(x) and h(x)=h0(x)pi+1(x)pi+2(x).
Case 2: p∣a. In this case bx+c is not divisible by 3 for all integer x, whence 3∣b and 3∣c. Thus there exists integer c0 such that cc0≡1(mod3). So we can set h(x)≡0 and f(x)=c0(x6+x4+x2+1).