My approach :
Suppose there exists such a continuous surjective map.
Then since $[0,1]$ is compact, $SL_2(\Bbb R)$ is also compact.
So essentially what I have to prove is that $SL_n(\Bbb R)$ is compact i.e. closed and bounded.
I know that determinant map is continuous. As $SL_2(\Bbb R)=\det^{-1}\{1\}$ and $\{1\}$ is a closed set, hence $SL_2(\Bbb R)$ is a closed set.
I don't know how to go about boundedness of $SL_2(\Bbb R)$. Nevertheless, if it turns out to be bounded set, then it would mean that such $f$ exists(correct me if I'm wrong here). and if it doesn't, then such a $f$ doesn't exist.
Also how to construct such an $f$ if it does exist?
You are trying to prove a false result, since $SL_n(\mathbb R)$ (and even $SL_2(\mathbb R)$) is not a compact set because it is not bounded.
In finite dimension, all norms are equivalent, so let's consider without loss of generality a norm on $M_n(\mathbb R)$:
$$\vert \vert M \vert \vert=\sup_{i,j}\vert m_{i,j}\vert.$$
Then consider the matrix (for $k\geqslant 1$):
$$M:=\begin{pmatrix} 1 & k \\ 0 & 1\end{pmatrix}\in SL_2(\mathbb R)$$
but
$$\vert \vert M \vert \vert=k\xrightarrow[k\to\infty]{} +\infty$$
so $SL_2(\mathbb R)$ is not bounded.