\(n^6-n^4-n^2+1\\ =n^4\left(n^2-1\right)-\left(n^2-1\right)\\ =\left(n^4-1\right)\left(n-1\right)\left(n+1\right)\\ =\left(n^2-1\right)\left(n^2+1\right)\left(n-1\right)\left(n+1\right)\\ =\left(n-1\right)\left(n+1\right)\left(n-1\right)\left(n+1\right)\\ =\left(n-1\right)^2\left(n+1\right)^2\)