$P^{-1}AP=\pmatrix{1&-\tfrac{1}{a}\\-\tfrac{1+a^2}{ab}&0}^{-1}\pmatrix{a&b\\-\tfrac{1+a^2}{b}&-a}\pmatrix{1&-\tfrac{1}{a}\\-\tfrac{1+a^2}{ab}&0}=\pmatrix{0&-1\\1&0}$
This statement is true. How would I find P if I would know only A and $\pmatrix{0&-1\\1&0}$? I need an easy way.
Comes from this Proving that every $2\times 2$ matrix $A$ with $A^2 = -I$ is similar to a given matrix.