My doubt is: if $A^2$ is similar to $B^2$, then $A$ is similar to $B$. Are the following steps correct?
$\implies B^2 = P^{-1}A^2P$
$\implies B^2B^{-1} = P^{-1}A^2PB^{-1} $
$\implies B=P^{-1}A^2PB^{-1}$
$\implies PB=PP^{-1}A^2PB^{-1}$
$\implies PBP^{-1}=A^2PB^{-1}P^{-1}$
I have proved if $A$ and $B$ are similar, $A^{-1}$ and $B^{-1}$ are also similar. Therefore, $PB^{-1}P^{-1} = A^{-1}$
$\implies PBP^{-1}=A^2A^{-1}$ $\implies PBP^{-1}=A$
Hence, A and B are similar.
Edit: As mentioned below, this proof is incorrect because the matrices have to be invertible for $PB^{-1}P^{-1}=A^{-1}$ and I have assumed the matrices to be similar which is the thing we are trying to prove.
Regards
You made a logical leap in your statement $A^2PB^{-1}P^{-1} = A^2A^{-1}$. Why would this be true.
What you are trying to prove is false, even assuming invertibility of $A$ and $B$. Consider $A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ \end{pmatrix}$ and $A = \begin{pmatrix} -1 & 0 \\ 0 & -1 \\ \end{pmatrix}$.