Note that $P$ is an elementary matrix. Moreover:
1) Multiplication of $A$ by $P$ on the right interchanges columns one and two of $A$.
2) Multiplication of $A$ by $P$ on the left interchanges rows one and two of $A$.
3) $P^{-1}=P$.
Now suppose $B=[\,A|P\,]$ and that
$B$ is similar to $ \left[
\begin{array}{ c c }
1&0&0&x_1&x_2&x_3 \\
0&1&0&x_4&x_5&x_6 \\
0&0&1&x_7&x_8&x_9
\end{array} \right] $ (I assume this is what the OP meant).
Then $[AP|PP]=[\,AP\,|I\,\,]$ is similar to
$ \left[
\begin{array}{ c c }
0&1&0&x_2&x_1&x_3 \\
1&0&0&x_5&x_4&x_6 \\
0&0&1&x_8&x_7&x_9
\end{array} \right]\sim
\left[
\begin{array}{ c c }
1&0&0&x_5&x_4&x_6 \\
0&1&0&x_2&x_1&x_3 \\
0&0&1&x_8&x_7&x_9
\end{array} \right]
$
So $(AP)^{-1} =\left[ \matrix{
x_5&x_4&x_6 \\
x_2&x_1&x_3 \\
x_8&x_7&x_9
}\right]$.
Now $PA^{-1}=P^{-1}A^{-1}=(AP)^{-1}$; whence $A^{-1}=P(AP)^{-1}$, so:
$$
A^{-1} =P\left[ \matrix{
x_5&x_4&x_6 \\
x_2&x_1&x_3 \\
x_8&x_7&x_9
}\right]= \left[ \matrix{
x_2&x_1&x_3 \\
x_5&x_4&x_6 \\
x_8&x_7&x_9
}\right].
$$
The last three columns of $B$ give the matrix $P$, which is described above.