[EDIT: Dan Asimov notified me that this construction is similar to a construction in his 1985 paper entitled "The Grand Tour: a Tool for Viewing Multidimensional Data". The construction in the 1985 paper is somewhat more elegant than this one, avoiding the use of the exponential map and the sine function.]
We'll describe such a function $f$ as the composition of three continuous maps:
- $h : [0, +\infty) \rightarrow [-1,1]^{\binom{n}{2}}$;
- $g : [-1,1]^{\binom{n}{2}} \rightarrow \mathcal{A}$;
- $j : \mathcal{A} \rightarrow SO(n)$;
where $\mathcal{A}$ is the space of antisymmetric matrices with entries in $[-1, 1]$.
Each of these three maps, and thus their composition $f$, is not only continuous but is in fact Lipschitz-continuous (unlike a spacefilling curve).
In reverse order:
- $j(A) := \exp((\pi \sqrt{n}) A)$, where $\exp$ is the matrix exponential;
- $g^{-1}(A)$ is the vector $v$ obtained by 'flattening' the entries in the upper triangle of $A$ into a vector of $\binom{n}{2}$ elements, and $g$ is the inverse of the function $g^{-1}$ just described;
- $h(t) := (\sin(c_1 t), \sin(c_2 t), \dots, \sin(c_{\binom{n}{2}} t))$, where $c_1, c_2, \dots, c_{\binom{n}{2}}$ are a set of $\binom{n}{2}$ irrationals that are linearly independent over $\mathbb{Q}$.
The image of $h$ is dense in the hypercube as mentioned here:
https://en.wikipedia.org/wiki/Linear_flow_on_the_torus
and, because $g$ is a homeomorphism, it follows that $g(h(t))$ is dense in $\mathcal{A}$. As such, it remains to show that $j$ is surjective onto $SO(n)$; that would establish that $f(t) = j(g(h(t)))$ is dense in $SO(n)$.
Claim: Every matrix $R \in SO(n)$ is expressible as the matrix exponential of an antisymmetric matrix $A$ with Hilbert-Schmidt norm $\operatorname{tr}(A^T A) \leq \pi^2 n$.
Proof: By an orthogonal change of basis, we can assume that the matrix $R$ is block-diagonal, consisting of $1 \times 1$ blocks of the form:
$$ \begin{pmatrix} 1 \end{pmatrix} $$
and $2 \times 2$ blocks of the form:
$$ \begin{pmatrix} \cos{\theta} & \sin{\theta} \\ -\sin{\theta} & \cos{\theta} \end{pmatrix} $$
where $\theta \in [-\pi, \pi]$. As such, $R$ is the matrix exponential of a block-diagonal antisymmetric matrix with blocks of the form:
$$ \begin{pmatrix} 0 \end{pmatrix} $$
and:
$$ \begin{pmatrix} 0 & \theta \\ -\theta & 0 \end{pmatrix} $$
The result follows.
Corollary: Every orthogonal matrix is the matrix exponential of an antisymmetric matrix with entries in $[-\pi \sqrt{n}, \pi \sqrt{n}]$. As such, $j$ is indeed surjective onto $SO(n)$.