<s>[INST] Finding a row-reduced echelon matrix. $A =\begin{pmatrix} 1& 2& 1& 0\\ -1 &0 &3 &5\\  1& -2& 1& 1\end{pmatrix}$.
I should find a row-reduced echelon matrix $R$ which is row equivalent to $A$ and an invertible $3 \times 3$ matrix $P$ such that $R = PA$.
I know that if a matrix is row equivalent to another that means that we can obtain such a matrix by using elementary row operations. But how should i apply this to such question? 
 [/INST] $$A =\begin{pmatrix} \;1& 2& 1& 0\\ \!\!-1 &0 &3 &5\\  \;1& \!\!-2& 1& 1\end{pmatrix}\stackrel{R_2+R_1\,,\,R_3-R1}\longrightarrow\begin{pmatrix} \;1& 2& 1& 0\\ 0 &2 &4 &5\\  0& \!\!-4& 0& 1\end{pmatrix}\stackrel{R_3+2R_2}\longrightarrow \begin{pmatrix} \;1& 2& 1& 0\\ 0 &2 &4 &5\\  0& 0& 8& 11\end{pmatrix}$$
Now, for example: to add 1st. row to 2nd one and to substract 1st. one from 3rd. one is to multiply $\,A\,$ from the left by matrix
$$P_1:=\begin{pmatrix}1&0&0\\1&1&0\\\!\!\!-1&0&1\end{pmatrix}$$
Take it from here, and show that each step you get an $invertible$ $\,3\times 3\,$ matrix, so at the end $\,P\,$ is a product of these matrices and, thus, an invertible one.
Added: Thus, 
$$P_1A=\begin{pmatrix} \;1& 2& 1& 0\\ 0 &2 &4 &5\\  0& \!\!-4& 0& 1\end{pmatrix}$$
which is the middle matrix above. 
Now you try to generalize the above to ge the matrix $\,P_2\,$ s.t. $\,P_2P_1A\,$ gives us the rightmost matrix above (the already reduced form)
</s>