Divide by (x−1) and keep going until a remainder is nonzero. Synthetic division of 1,−2,2,−2,1 by 1 gives the row 1,−1,1,−1 with remainder 0, so the quotient is x3−x2+x−1.
Divide again. Synthetic division of 1,−1,1,−1 by 1 gives 1,0,1 with remainder 0, so the new quotient is x2+1.
Test a third time.
12+1=2=0
The third division fails, so the multiplicity is exactly 2 and p(x)=(x−1)2(x2+1).