There is a sentense that says that every symmetric matrix is congruent to a diagonal matrix.
I've been trying to find the congruent matrix and the transition matrix for the following: $$ \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} $$
The method I learned to get to a solution is to do row operations on both the matrix and the identity matrix, and the according column operations on the original matrix only until I get to a diagonal matrix from the original and the transition matrix from the identity matrix.
This process seems to loop infinitly in with this matrix when I switch rows 2 and 3.
So I need to know how to find the congruent diagonal matrix and the transition matrix for the given matrix and a method which will be fail-proof.
Rather than switching the columns, add the third row to the second, and work from there.
I am not familiar with the algorithm you describe, and so I can't tell you why switch the rows would cause it to fail. However, you should find that $$ P = \pmatrix{1&0&0&0\\ 0&1&1&0\\ 0&1&-1&0\\ 0&0&0&1} $$ will work for your purposes (incidentally, note that $P = P^T$).
In terms of row-column operations, here's how it would go: $$ \pmatrix{1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1} \quad \text{...II = II + III}\\ \pmatrix{ 1&0&0&0\\ 0&2&1&0\\ 0&1&0&0\\ 0&0&0&1} \quad \text{...III= 2 III - II}\\ \pmatrix{ 1&0&0&0\\ 0&2&0&0\\ 0&0&-2&0\\ 0&0&0&1} $$ I'm not sure if this is correct