[proofplan]
We prove unimodularity by showing that the modular function is identically equal to $1$. For compact Lie groups this follows from the compact-group unimodularity theorem. For connected semisimple Lie groups, we compute the differential of the logarithm of the modular function and identify it with the trace of the adjoint operator. Semisimplicity forces every adjoint operator to have trace zero, so the modular function has zero differential; connectedness then forces the modular function to be constant, hence equal to $1$.
[/proofplan]
[step:Reduce unimodularity to the modular function]
Let $G$ be a finite-dimensional real Lie group with identity element $e$. Let $\mu$ be a left Haar measure on $G$, and define the modular function
\begin{align*}
\Delta:G\to \mathbb R_+
\end{align*}
by the condition
\begin{align*}
(R_g)_*\mu=\Delta(g)\mu
\end{align*}
for every $g\in G$, where $R_g:G\to G$ is the right translation map $R_g(x)=xg$.
By [citetheorem:8830], $\Delta$ is a continuous [group homomorphism](/page/Group%20Homomorphism). The group $G$ is unimodular exactly when $\Delta(g)=1$ for every $g\in G$, equivalently when a left Haar measure is also right invariant.
[/step]
[step:Apply compact-group unimodularity to the compact case]
Assume first that $G$ is compact. Since every compact Lie group is a compact group, [citetheorem:8829] applies and gives that every normalized left Haar measure on $G$ is right invariant. Therefore the modular function of $G$ is identically $1$, and $G$ is unimodular.
[/step]
[step:Compute the infinitesimal modular character]
Assume now that $G$ is connected and that its [Lie algebra](/page/Lie%20Algebra) $\mathfrak g=T_eG$ is semisimple. Choose a nonzero alternating form
\begin{align*}
\omega_e:\Lambda^{\dim G}\mathfrak g\to \mathbb R.
\end{align*}
Let $\omega$ be the left-invariant smooth volume form on $G$ determined by $\omega_e$, so that for each $a\in G$ and each $v_1,\dots,v_{\dim G}\in T_aG$,
\begin{align*}
\omega_a(v_1,\dots,v_{\dim G})
=
\omega_e(d(L_{a^{-1}})_a v_1,\dots,d(L_{a^{-1}})_a v_{\dim G}).
\end{align*}
For $g\in G$, the pullback $(R_g)^*\omega$ is again left invariant. Hence it is determined by its value at $e$. For $X_1,\dots,X_{\dim G}\in\mathfrak g$,
\begin{align*}
((R_g)^*\omega)_e(X_1,\dots,X_{\dim G})
=
\omega_g(d(R_g)_eX_1,\dots,d(R_g)_eX_{\dim G}).
\end{align*}
Using the defining formula for $\omega_g$ and the identity
\begin{align*}
d(L_{g^{-1}})_g\circ d(R_g)_e=d(C_{g^{-1}})_e=\operatorname{Ad}_{g^{-1}},
\end{align*}
we obtain
\begin{align*}
((R_g)^*\omega)_e(X_1,\dots,X_{\dim G})
=
\omega_e(\operatorname{Ad}_{g^{-1}}X_1,\dots,\operatorname{Ad}_{g^{-1}}X_{\dim G}).
\end{align*}
Thus
\begin{align*}
(R_g)^*\omega=\det(\operatorname{Ad}_{g^{-1}})\omega.
\end{align*}
The Haar measure associated to $|\omega|$ is left invariant, so the defining convention for $\Delta$ gives
\begin{align*}
\Delta(g)=\left|\det(\operatorname{Ad}_{g^{-1}})\right|.
\end{align*}
Since $G$ is connected and $\operatorname{Ad}_e=\operatorname{id}_{\mathfrak g}$, the determinant $\det(\operatorname{Ad}_{g^{-1}})$ is positive for every $g\in G$. Therefore
\begin{align*}
\Delta(g)=\det(\operatorname{Ad}_{g^{-1}}).
\end{align*}
For $X\in\mathfrak g$, define
\begin{align*}
\gamma_X:\mathbb R\to G,\qquad t\mapsto \exp(tX).
\end{align*}
Then
\begin{align*}
\Delta(\gamma_X(t))
=
\det(\operatorname{Ad}_{\exp(-tX)})
=
\det(\exp(-t\,\operatorname{ad}_X)).
\end{align*}
Using the finite-dimensional identity $\det(\exp A)=\exp(\operatorname{tr}A)$, we get
\begin{align*}
\Delta(\exp(tX))
=
\exp(-t\,\operatorname{tr}(\operatorname{ad}_X)).
\end{align*}
Consequently,
\begin{align*}
d(\log\Delta)_e(X)=-\operatorname{tr}(\operatorname{ad}_X).
\end{align*}
[guided]
The modular function measures how a left Haar measure changes under right translation. To compute this infinitesimally, we express the left Haar measure locally using a left-invariant volume form.
Choose a nonzero alternating form
\begin{align*}
\omega_e:\Lambda^{\dim G}\mathfrak g\to \mathbb R.
\end{align*}
There is a unique left-invariant smooth volume form $\omega$ on $G$ with value $\omega_e$ at the identity. Explicitly, for $a\in G$ and $v_1,\dots,v_{\dim G}\in T_aG$,
\begin{align*}
\omega_a(v_1,\dots,v_{\dim G})
=
\omega_e(d(L_{a^{-1}})_a v_1,\dots,d(L_{a^{-1}})_a v_{\dim G}).
\end{align*}
Now fix $g\in G$. Since right translations commute with left translations, $(R_g)^*\omega$ is also left invariant. Therefore it is enough to compute its value at $e$. For $X_1,\dots,X_{\dim G}\in\mathfrak g$,
\begin{align*}
((R_g)^*\omega)_e(X_1,\dots,X_{\dim G})
=
\omega_g(d(R_g)_eX_1,\dots,d(R_g)_eX_{\dim G}).
\end{align*}
By the definition of the left-invariant form at the point $g$, this equals
\begin{align*}
\omega_e(d(L_{g^{-1}})_g d(R_g)_eX_1,\dots,d(L_{g^{-1}})_g d(R_g)_eX_{\dim G}).
\end{align*}
The composition $L_{g^{-1}}\circ R_g$ is the conjugation map $C_{g^{-1}}:h\mapsto g^{-1}hg$, so its differential at $e$ is $\operatorname{Ad}_{g^{-1}}$. Hence
\begin{align*}
((R_g)^*\omega)_e(X_1,\dots,X_{\dim G})
=
\omega_e(\operatorname{Ad}_{g^{-1}}X_1,\dots,\operatorname{Ad}_{g^{-1}}X_{\dim G}).
\end{align*}
By the defining property of the determinant on top exterior powers,
\begin{align*}
(R_g)^*\omega=\det(\operatorname{Ad}_{g^{-1}})\omega.
\end{align*}
The left-invariant measure associated to $|\omega|$ is a left Haar measure. With the convention
\begin{align*}
(R_g)_*\mu=\Delta(g)\mu,
\end{align*}
the preceding scaling formula gives
\begin{align*}
\Delta(g)=\left|\det(\operatorname{Ad}_{g^{-1}})\right|.
\end{align*}
Because $G$ is connected, the [continuous function](/page/Continuous%20Function) $g\mapsto \det(\operatorname{Ad}_{g^{-1}})$ cannot change sign, and it equals $1$ at $g=e$. Thus it is positive everywhere, so
\begin{align*}
\Delta(g)=\det(\operatorname{Ad}_{g^{-1}}).
\end{align*}
Finally take $g=\exp(tX)$ for $X\in\mathfrak g$. The adjoint representation differentiates to the infinitesimal adjoint action, so
\begin{align*}
\operatorname{Ad}_{\exp(-tX)}=\exp(-t\,\operatorname{ad}_X).
\end{align*}
Applying the determinant-trace formula for finite-dimensional endomorphisms,
\begin{align*}
\det(\exp A)=\exp(\operatorname{tr}A),
\end{align*}
with $A=-t\,\operatorname{ad}_X$, gives
\begin{align*}
\Delta(\exp(tX))
=
\exp(-t\,\operatorname{tr}(\operatorname{ad}_X)).
\end{align*}
Taking the derivative at $t=0$ after applying $\log$ yields
\begin{align*}
d(\log\Delta)_e(X)=-\operatorname{tr}(\operatorname{ad}_X).
\end{align*}
This is the infinitesimal modular character.
[/guided]
[/step]
[step:Use semisimplicity to make the infinitesimal modular character vanish]
Since $\mathfrak g$ is semisimple, its derived algebra satisfies
\begin{align*}
[\mathfrak g,\mathfrak g]=\mathfrak g.
\end{align*}
Hence every $X\in\mathfrak g$ can be written as a finite sum
\begin{align*}
X=\sum_{j=1}^m [Y_j,Z_j]
\end{align*}
for some $m\in\mathbb N$ and some $Y_j,Z_j\in\mathfrak g$.
The adjoint map
\begin{align*}
\operatorname{ad}:\mathfrak g\to \mathfrak{gl}(\mathfrak g),\qquad X\mapsto \operatorname{ad}_X
\end{align*}
is a Lie algebra homomorphism, so
\begin{align*}
\operatorname{ad}_{[Y_j,Z_j]}=[\operatorname{ad}_{Y_j},\operatorname{ad}_{Z_j}]
\end{align*}
for every $j\in\{1,\dots,m\}$. Therefore
\begin{align*}
\operatorname{tr}(\operatorname{ad}_X)
=
\sum_{j=1}^m
\operatorname{tr}([\operatorname{ad}_{Y_j},\operatorname{ad}_{Z_j}]).
\end{align*}
For finite-dimensional endomorphisms $A,B:\mathfrak g\to\mathfrak g$, cyclicity of trace gives
\begin{align*}
\operatorname{tr}([A,B])
=
\operatorname{tr}(AB-BA)
=
\operatorname{tr}(AB)-\operatorname{tr}(BA)
=
0.
\end{align*}
Thus $\operatorname{tr}(\operatorname{ad}_X)=0$ for every $X\in\mathfrak g$. By the formula from the previous step,
\begin{align*}
d(\log\Delta)_e(X)=0
\end{align*}
for every $X\in\mathfrak g$.
[/step]
[step:Use connectedness to conclude that the modular function is trivial]
Define
\begin{align*}
\lambda:G\to(\mathbb R,+),\qquad g\mapsto \log(\Delta(g)).
\end{align*}
Since $\Delta:G\to\mathbb R_+$ is a continuous group homomorphism and $\log:\mathbb R_+\to\mathbb R$ is a Lie group isomorphism from the multiplicative positive reals to the additive reals, $\lambda$ is a continuous Lie group homomorphism. The preceding step shows that
\begin{align*}
d\lambda_e=0.
\end{align*}
For each $g\in G$, let $\lambda(G)\subset\mathbb R$ denote the image subgroup. Because $G$ is connected and $\lambda$ is continuous, $\lambda(G)$ is a connected subgroup of $(\mathbb R,+)$. Also $d\lambda_e=0$ implies that the Lie algebra of $\lambda(G)$ is $\{0\}$, so the identity component of $\lambda(G)$ is $\{0\}$. The only connected subgroup of $\mathbb R$ with zero tangent space at $0$ is $\{0\}$. Hence
\begin{align*}
\lambda(G)=\{0\}.
\end{align*}
Therefore $\log(\Delta(g))=0$ for every $g\in G$, and so
\begin{align*}
\Delta(g)=1
\end{align*}
for every $g\in G$. Thus $G$ is unimodular.
Combining this with the compact case proves both assertions.
[/step]