How to prove that $GL(n,\mathbb R)$ is not connected subset and open subset of$M_n (\mathbb{R})$
The set $\text{GL}(n,\mathbb{R})$ consists of all non-singular $n \times n$ matrices with real entries. It is an $n^2$-dimensional real manifold. Given a matrix $X \in \text{GL}(n,\mathbb{R})$ use $x_{ij} \in \mathbb{R}$ to denote the entry in the $i^{\text{th}}$ row and $j^{\text{th}}$ column. In other words:
$$X = \left( \begin{array}{ccc} x_{11} & \cdots & x_{1n} \\ \vdots & \ddots & \vdots \\ x_{n1} & \cdots & x_{nn}\end{array}\right)$$
It follows that the determinant $\det(X)$ is a polynomial in the $n^2$-variables:
$$\det(X) \in \mathbb{R}[x_{11},\ldots,x_{1n},\ldots,x_{n1},\ldots,x_{nn}] \, . $$
The key point here is that polynomials are continuous functions.
The function $\det : \text{Mat}(n,\mathbb{R}) \to \mathbb{R}$ is continuous. By the definition of continuity, the inverse image of the open set $\{ x \in \mathbb{R} : x<0\}$ is open in $\text{Mat}(n,\mathbb{R})$. Thus, the non-singular matrices with negative determinant form an open subset of $\text{Mat}(n,\mathbb{R}).$ Similarity: the inverse image of the open set $\{ x \in \mathbb{R} : x>0\}$ is open in $\text{Mat}(n,\mathbb{R})$. Thus, the non-singular matrices with positive determinant form an open subset of $\text{Mat}(n,\mathbb{R}).$
Recall that if $X$ is connected and $f:X \to Y$ is a continuous function then $Y$ is connected. The contrapositive tells us that if $Y$ is not connected and $f : X \to Y$ is a continuous function the $X$ is not connected. To show that $X = \text{GL}^+(n,\mathbb{R}) \cup \text{GL}^-(n,\mathbb{R})$ is not connected, we need to show that $\mathbb{R}^+ \cup \mathbb{R}^-$ is not connected. This can be done because $\det : \text{Mat}(n,\mathbb{R}) \to \mathbb{R}$ is continuous.
To do this, we need to show that:
$$\begin{array}{ccc} \overline{\mathbb{R}^+} \cap \mathbb{R}^- &=& \emptyset \\ \mathbb{R}^+ \cap \overline{\mathbb{R}^-} &=& \emptyset \end{array}$$
This is clearly true since: $$\begin{array}{ccccc} \overline{\mathbb{R}^+} \cap \mathbb{R}^- &=& (-\infty,0) \cap [0,\infty) &=& \emptyset \\ \mathbb{R}^+ \cap \overline{\mathbb{R}^-} &=& (-\infty,0] \cap (0,\infty) &=& \emptyset \end{array}$$
Observe that $\det$ is continuous and is either positive or negative, but never zero.