As pointed out in the comment the claim is false. This was proven by John Millson in the paper Real vector bundles with discrete structure group, Topology, 1979 doi.
"We also obtain the following theorem in group theory. Let $\mathcal{O}$ be the ring of integers in the real quadratic field $\mathbb{Q}(\sqrt{p})$, where $p$ is a rational prime $p = 7 \pmod 8$. Then by choosing an embedding of $\mathbb{Q}(\sqrt{p})$ into $\mathbb{R}$ we obtain $p : \operatorname{SL}(n, \mathcal{O})\to\operatorname{SL}(n, \mathbb{R})$ and consequently an extension $\mathbb{Z}/2\mathbb{Z} \to \overline{\operatorname{SL}(n, \mathcal{O})}\to \operatorname{SL}(n, \mathcal{O})$. We prove that this extension does not become trivial when restricted to any subgroup of finite index of $\operatorname{SL}(n, \mathcal{O})$, consequently the group $\overline{\operatorname{SL}(n, \mathcal{O})}$ is not residually finite." - Bottom of first page.
The "correct", stronger result of Mal'cev is:
Theorem (Mal'cev). A split extension $G$ of a finitely generated, residually finite group $N$ by a residually finite group $K$ is residually finite.
The proof is surprisingly straightforward.
Proof. Write $G=N\rtimes K$. As $N$ is finitely generated, the intersection $N_i$ of all subgroups of a fixed finite $i$ in $N$, $N_i=\cap_{|N_i:H|=i}H$, is a characteristic subgroup of $N_i$ which still has finite index. Hence, $N_i$ is normal in $G$. Therefore, if $K'$ is a finite index subgroup of $K$ then $N_iK'$ is a finite index subgroup of $G$. The result now holds, as if $g=(n, k)$ is some element of $G$ then we may take $N_i$ and $K'$ such that $n\not\in N_i$ and $k\not\in K'$, so $g\not\in N_iK$ as required. QED
Note that we assume finite generation of the kernel. This is required to ensure that $N_iK'$ is a subgroup, and without it the result also does not hold (for example, take the wreath product of a nonabelian finite group $H$ by the integers, which splits as $H'\rtimes\mathbb{Z}$ where $H'$ denotes the countable direct product of $H$ with itself).
A powerful result which does not assume finite generation of the kernel is the following:
Theorem (Baumslag). A finitely generated cyclic extension of a free group is residually finite.
Here we are assuming finite generation of the group, rather than of the kernel. The proof here is much more complicated than the proof of Mal'cev's theorem given above!