Let $$S := \left\{ {\bf X} \in \Bbb R^{4 \times 4} \mid \operatorname{rank} ({\bf X}) \leq 2 \right\}$$ Is $S$ closed with respect to the usual Euclidean metric?
I think so. My reasoning is the following:
Let $({\bf A}_n)$ be a sequence in $S$ converging to a matrix $\bf A$. We observe that the row operations performed in order to get row echelon form are continous. Let ${\bf A}'_n$ denote the row echelon form of ${\bf A}_n$. Since the rank is preserved, there are at most two nonzero rows in ${\bf A}'_n$. Let ${\bf A}'_n = \phi({\bf A}_n)$ for some continous function $\phi.$ Since $A_n$ converges, we must have that ${\bf A}_n'$ converges. Since ${\bf A}'_n$ converges, it follows that its corresponding entries also converge, so the limiting matrix will have at most $2$ nonzero rows, or equivalently, a rank of at most $2$. The limit matrix must be the row echelon form of ${\bf A}$, so ${\bf A}$ is in $S$.
Is there any problem with the above argument?
I do not think that your proof is correct. You claim that there is a "universal sequence of row operations" transforming all matrices into echelon form. But it seems to me that we need different sequences of row operations for different matrices. Only if you can prove that there actually exists a universal sequence of row operations, you would get a continuous function $\phi$ assigning to each matrix $A$ a matrix $\phi(A)$ in echelon form. I doubt that, but maybe I am wrong.
So what can be done? I think Didier's comment is an essential ingredient. We know that a matrix $A$ has rank $\le 2$ iff all $3 \times 3$-minors $A^{i,j}$ obtained from $A$ by eliminating row $i$ and column $j$ have vanishing determinant. Now consider a sequence $(A_n)$ of matrices with rank $\le 2$ which converges to a matrix $A$. Consider all sequences $(A^{i,j}_n)$ of $3 \times 3$-minors. They converge to the minors $A^{i,j}$ of $A$. Since the determinant is continuous, all $A^{i,j}$ have vanishing determinant which means that $A$ has rank $\le 2$.