Proving that matrices $B$ produced by transposing two rows of $I$ satisfy $B=B^{-1}$? For example, I have a $3 \times 3$ identity matrix. If I exchange rows $2$ and $3$, then I get 
$$
B = \pmatrix{1&0&0\\0&0&1\\0&1&0}.
$$
In this case it can be checked that $B=B^{-1}$. 
I would like to show the following:

If we exchange any two rows in an $n\times n$ identity matrix to get a new matrix $B$, then $B=B^{-1}$.

I tested other dimensions, such as $4\times 4$,  $5\times 5$ and $100\times 100$ on my Mathematica. But I don't know how to prove it?
 A: Switching rows is equivalent to multiplication with a permutation matrix $P$, and because switching two times does "nothing" you have $P^2=I$ and therefore with $B=PI$ you get $B^2=BB=PIPI= PPI=II=I.$ And this shows $B^{-1}=B$. 
A: Let $S$ denote the matrix formed by transposing the $i$th and $j$th rows of the $n \times n$ identity matrix, and let 
It's easy to compute how $S$ acts in the standard basis $(e_a)$ of $\mathbb{F}^n$: We have $S e_i = e_j$, $S e_j = e_i$, and $S e_k = e_k$ for all $k \neq i, j$. In particular, for every basis element, $S^2 e_a S(S e_a) = e_a$, and so by linearity $S^2$ is the identity: $$S^2 = I.$$ In particular, $S$ is its own inverse.
More generally, matrices produced by permuting the rows of the $n \times n$ identity matrix are called permutation matrices, because they permute the standard basis. Any permutation of the standard basis can be encoded by a unique matrix of this type, so we can simply think of these matrices as the same thing as permutations on $n$ objects. A permutation matrix produced by transposing the $i$th and $j$th rows corresponds to the transposition permutation $(ij)$, and all transpositions are their own inverses.
A: Suppose you switch rows $i$ and $j$ to get a matrix $B$. Let $e_{i}$ be the underlying basis, considered as row vectors. Now note that
$$
e_{k} B = e_{k}
$$
for $k \notin \{ i, j\}$,
while
$$
e_{i} B = e_{j},
\qquad
e_{j} B = e_{i}.
$$
Clearly you will have
$$
e_{k} B^{2} = e_{k},
$$
for all $k$, so $B^{2}$ is the identity.
