If $A$ is a matrix such that $A^3 = 2I$, prove that $B = A^2 - 2A + 2I$ is an invertible matrix.
I tried to use $A^3 = 2I$ and turn it to $(A-I)(A^2 + A + I) = I$ but it didn't work. also I tried to suppose $B$ has inverse and solve the problem but it didn't work either.