is $GL(n,\mathbb R)$ dense in $M(n,\mathbb R)$

Yes, $GL(n,\mathbb R)$ is dense in $M(n,\mathbb R)$.

Using the determinant function $\det:M(n,\mathbb R)\rightarrow \mathbb R$, check that for small values of $\varepsilon$, the matrix $A+\varepsilon I_n$ is invertible.


Hint: A matrix has finitely many eigenvalues. If none of them is $0$, ...


Since this is posted under the tag metric spaces, I will show that the statement is not true for every metric:

Let $d$ be the discrete metric: $$ d(A,B) = \begin{cases} 0 & \text{ if } A=B\\ 1 & \text{ if } A\ne B.\end{cases} $$ Then $$ d(0,B) =1 $$ for all invertible $B$, hence $GL(n,\mathbb R)$ is not dense in $M(n,\mathbb R)$.

If the metric is induced by a norm, $d(A,B)=\|A-B\|$, then the statement is true. Let $A$ be not invertible. Then there are invertible matrices $S,T$ such that $$ SAT = \pmatrix{ I_r & 0 \\ 0 & 0 }, $$ with $r=rank(A)$. Now let $\epsilon\ne0$ be given. Set $$ A_\epsilon := S^{-1} \pmatrix{ (1+\epsilon)I_r & 0 \\ 0 & \epsilon I_{n-r} } T^{-1} = A + \epsilon S^{-1}T^{-1}. $$ This matrix is clearly invertible as a product of invertible matrices $S^{-1}$, $\pmatrix{ (1+\epsilon)I_r & 0 \\ 0 & \epsilon I_{n-r} }$, $T^{-1}$. Then $$ A-A_\epsilon = S^{-1}\pmatrix{ -\epsilon I_r & 0 \\ 0 & -\epsilon I_{n-r}} T^{-1} = - \epsilon S^{-1}T^{-1}, $$ which shows $$ \|A-A_\epsilon\| = |\epsilon|\cdot \|S^{-1}T^{-1}\|. $$ And $GL(n,\mathbb R)$ is dense in $M(n,\mathbb R)$.