In 7, $x^3- 1= (x- 1)(x^2- x+ 1)$ and $x^4- x^3+ x^2- 1= (x- 1)(x^3+ x+ 1 )$.
The two polynomials, $x^2- x+ 1$ and $x^3+ x+ 1$ are "irreducible" over the natural numbers. But working in $Z_7$, we need to check their values for x= 0, 1, 2, 3, 4, 5, and 6 "mod 7". $3^2- 3+ 1= 7$ and $5^2- 5+ 1= 25- 5+ 1= 21$, a multiple of 7 so $x^2- x+ 1= (x- 5)(x- 3)$ (mod 7) so we can write $x^3- 1= (x- 1)(x- 3)(x- 5)$ mod 7. No value from 0 to 6 makes $x^3+ x+ 1$ a multiple of 7 so it is irreducible even in $Z_7$.
In $Z_7$ $x^3- 1= (x- 1)(x- 3)(x- 5)$ and $x^4- x^3+ x^2- 1= (x- 1)(x^3+ x+ 1)$. What is the greatest common divisor of those?