Prove that $\operatorname{SL}(n,\Bbb R)$ is connected.
Exercise 2.M.8(a) (Artin's Algebra, 2nd edition). The group $SL_n(\mathbb{R})$ is generated by elementary matrices of the first type (see Exercise 2.4.8). Use this fact to prove that $SL_n(\mathbb{R})$ is path-connected.
Let $\sim$ be the binary operation corresponding to path-connectivity in $SL_n(\mathbb{R})$; by my answer here, $\sim$ is an equivalence relation.
In order to show $SL_n(\mathbb{R})$ is path-connected, it suffices to show $A\sim I_n$ for all $A\in SL_n(\mathbb{R})$. But by my answer here, $A$ can be written as a (possibly empty) product of elementary matrices of the first type, so it in fact suffices to prove that$$E_{uv}(a)M\sim M$$for all $M\in SL_n(\mathbb{R})$ and Type 1 elementary matrices $E_{uv}(a)$ ($1\le u,\,v\le n$) of the form$$I_n + [a[(i,\,j) = (u,\,v)]]_{i,\,j\,=\,1}^n.$$Yet$$M\to E_{uv}(b)M$$simply adds $b$ times row $j$ to row $i$, i.e. takes $r_i$ to $r_i+br_j$. For fixed $u$, $v$, $M$, this map is continuous in $b$ (and preserves the determinant), so the continuous function$$X(t) = E_{uv}(ta)M$$over $[0,1]$ takes$$X(0) = M \to X(1) = E_{uv}(a)M$$while remaining inside $SL_n(\mathbb{R})$, as desired.
Hint: prove that if two matrices can be transformed one into another using row-echelon transformation, then they are connected.
as we focus on elements of $SL_n$, we only need to prove that transvections $L_i \to l_i + aL_j$ connect elements.
let $A\in SL_n$, $B$ is the image of $A$ under the transvection $L_i \to L_i + aL_j$.
Then $$ \gamma: [0,1]\to SL_n $$defined by "$\gamma(t)$ is the image of $A$ under the transvection $L_i \to L_i + taL_j$ " is continuous, and such as $\gamma(0) = A$, $\gamma(1) = B$ (also, check that for every $t$, $\gamma (t)\in SL_n$). Hence $A,B$ are path connected.
If you know the connectedness of $SO(n)$, there is an another approach.
Let $X \in SL(n) $ be given. By polar decomposition $X$ can be written as a product $X=UP$, where $U$ is an orthogonal matrix and $P$ is a positive-definite symmetric matrix. Here $\text{det}(U)=\text{det}(P)=1$ since $\text{det}(X)=1$. By the spectral theorem, $P=V^{-1}\mbox{diag}(\lambda_1, ... ,\lambda_n)V$ for some $V \in SO(n)$ and $\lambda_j \in (0, \infty)$.
This shows that the continuous map $$SO(n) \times SO(n) \times M \rightarrow SL(n)$$ given by $$\left( U, V, (x_1, ..., x_n) \right) \mapsto UV^{-1}\mbox{diag}(x_1, ..., x_n)V $$ is surjective, where $M$ denotes the embedded submanifold $\{(x_1, ..., x_n) \in \mathbb{R}^n_{>0} : x_1x_2...x_n=1\}$ of $\mathbb{R}^n_{>0}= \{(x_1, ..., x_n): x_1, ..., x_n >0 \}$.
To see M is (path) connected, let $(p_1, ..., p_n) \in M$ be given. Then $(p_1, ..., p_n)$ and $(1, p_1p_2, ...,p_n)$ is joined by the path
$$ t \mapsto (\frac{p_1}{\text{exp}(t \log p_1)}, \exp(t \log p_1)p_2, ... , p_n) $$
Inductively, we can construct a path from $(p_1, ..., p_n)$ to $(1, ..., 1)$.
As a proudct of connected spaces, $SO(n) \times SO(n) \times M$ is connected. Hence $SL(n)$ connected because it is a continuous image of a connected space.