$\begin{bmatrix} {\color{Red} 1} & -1& 0& 0& 0\\ 0& 0& 1& -1& 0\\ 0& 1& -1& 0& 0\\ -1& 0& 0& 0& 1\\ 0& 0& 0& 1& -1 \end{bmatrix} \xrightarrow[]{R4 \ \leftarrow \ R4 \ + \ R1} \begin{bmatrix} 1 & -1& 0& 0& 0\\ 0& 0& 1& -1& 0\\ 0& 1& -1& 0& 0\\ 0& -1& 0& 0& 1\\ 0& 0& 0& 1& -1 \end{bmatrix} \xrightarrow[]{R2\ \Leftrightarrow \ R3} \begin{bmatrix} {\color{Red} 1} & -1& 0& 0& 0\\ 0& {\color{Red} 1}& -1& 0& 0\\ 0& 0& 1& -1& 0\\ 0& -1& 0& 0& 1\\ 0& 0& 0& 1& -1 \end{bmatrix} \xrightarrow[]{R4 \ \leftarrow \ R4 \ + \ R2} \begin{bmatrix} {\color{Red} 1} & -1& 0& 0& 0\\ 0& {\color{Red} 1}& -1& 0& 0\\ 0& 0& {\color{Red} 1}& -1& 0\\ 0& 0& -1& 0& 1\\ 0& 0& 0& 1& -1 \end{bmatrix} \xrightarrow[]{R4 \ \leftarrow \ R4 \ + \ R3} \begin{bmatrix} {\color{Red} 1} & -1& 0& 0& 0\\ 0& {\color{Red} 1}& -1& 0& 0\\ 0& 0& {\color{Red} 1}& -1& 0\\ 0& 0& 0& {\color{Red} {-1}}& 1\\ 0& 0& 0& 1& -1 \end{bmatrix} \xrightarrow[]{R5 \ \leftarrow \ R5 \ + \ R4} \begin{bmatrix} {\color{Red} 1} & -1& 0& 0& 0\\ 0& {\color{Red} 1}& -1& 0& 0\\ 0& 0& {\color{Red} 1}& -1& 0\\ 0& 0& 0& {\color{Red} {-1}}& 1\\ 0& 0& 0& 0& 0 \end{bmatrix}$
Here, we can see that there are 4 columns with pivot elements (red colored elements). Therefore, the rank of the matrix = 4.