I was working on the following problem when I stumbled upon an oddity.
If $X=P^{-1}AP$ and $A^3=I$, prove that $X^3=I$
My first approach was to cube both side which led to the following:
$$X^3=(P^{-1}AP)^3$$ $$X^3=(P^{-1})^3A^3P^3$$ Since $A^3=I$ $$X^3=(P^{-1})^3I^3P^3$$ $$X^3=(P^{-1})^3P^3$$ $$X^3=(P^{-1}P)^3$$ $$X=I^3=I$$ However this method seemed to contradict what I had previously learned. Instead I tried this approach: $$X=P^{-1}AP$$ Now premultiply each side by X and we get: $$X^2=P^{-1}APP^{-1}AP=P^{-1}AIAP=P^{-1}A^2P$$
We do this once more: $$X^3=P^{-1}A^2PP^{-1}AP=P^{-1}A^2IAP=P^{-1}A^3P$$
Since $A^3=I$ $$X^3=P^{-1}IP=P^{-1}P=I$$
Does anyone know which approach is correct?
It is false in general that $(ABC)^3 = A^3B^3C^3$. This only holds if the elements commute. So you cannot go from $$(P^{-1}AP)^3$$ to $$(P^{-1})^3 A^3 P^3$$ in general, since the equality will not hold if $A$ does not commute with $P$.
Fortunately, in general we have that $$(P^{-1}AP)^n = P^{-1}A^nP$$ is true for all positive integers $n$ (and even for negative ones, if $A$ is invertible). This can be shown by induction on $n$ for positive integers: it is true for $n=1$, since $P^{-1}AP = P^{-1}AP$. Assuming the result is true for $n$, we have $$\begin{align*} (P^{-1}AP)^{n+1} &= (P^{-1}AP)^n(P^{-1}AP)\\ &= (P^{-1}A^nP)(P^{-1}AP)\\ &= P^{-1}A^n(PP^{-1})AP\\ &= P^{-1}A^nAP\\ &= P^{-1}A^{n+1}P \end{align*}$$
One can also see this by verify that the map $B\mapsto P^{-1}BP$ is actually a semigroup homomorphism on the multiplicative semigroup of matrices: for any $B$ and $C$, we have that $$P^{-1}(BC)P = (P^{-1}BP)(P^{-1}CP),$$ as can easily be verified. In fact, it's a ring homomorphism, since $$P{-1}(B+C)P = (P^{-1}BP) + (P^{-1}CP),$$ so conjugation behaves pretty well. But you cannot do what you did first.