[proofplan]
We first express each character as a sum of diagonal matrix coefficients with respect to an [orthonormal basis](/page/Orthonormal%20Basis). Schur orthogonality for matrix coefficients then gives the displayed character [inner product](/page/Inner%20Product) after summing over the diagonal indices. For completeness, Peter-Weyl decomposes $L^2(G,\mu_G)$ into irreducible coefficient blocks; the conjugation-fixed part of each block corresponds to endomorphisms commuting with the irreducible representation. [Schur's lemma](/theorems/2414) forces those endomorphisms to be scalar, so each fixed block is exactly the one-dimensional span of the corresponding character.
[/proofplan]
[step:Expand the characters into diagonal matrix coefficients]
Let $d_\pi:=\dim_{\mathbb C}V_\pi$ and $d_\sigma:=\dim_{\mathbb C}V_\sigma$. Choose orthonormal bases $(e_i)_{i=1}^{d_\pi}$ of $V_\pi$ and $(u_a)_{a=1}^{d_\sigma}$ of $V_\sigma$. For $1\le i\le d_\pi$ and $1\le a\le d_\sigma$, define continuous functions
\begin{align*}
c_i^\pi:G\to\mathbb C,\qquad g\mapsto (\pi(g)e_i,e_i)_{V_\pi}
\end{align*}
and
\begin{align*}
c_a^\sigma:G\to\mathbb C,\qquad g\mapsto (\sigma(g)u_a,u_a)_{V_\sigma}.
\end{align*}
Since trace is the sum of diagonal entries in any ordered basis, for every $g\in G$ we have
\begin{align*}
\chi_\pi(g)=\sum_{i=1}^{d_\pi}c_i^\pi(g)
\end{align*}
and
\begin{align*}
\chi_\sigma(g)=\sum_{a=1}^{d_\sigma}c_a^\sigma(g).
\end{align*}
[/step]
[step:Sum Schur orthogonality over the diagonal coefficients]
By [citetheorem:9715], applied to the irreducible unitary representations $\pi$ and $\sigma$ and to the vectors $e_i,e_i\in V_\pi$ and $u_a,u_a\in V_\sigma$, we have
\begin{align*}
\int_G c_i^\pi(g)\overline{c_a^\sigma(g)}\,d\mu_G(g)=0
\end{align*}
whenever $\pi$ and $\sigma$ are not unitarily equivalent. Therefore finite additivity of the integral gives
\begin{align*}
\int_G \chi_\pi(g)\overline{\chi_\sigma(g)}\,d\mu_G(g)=0.
\end{align*}
Suppose now that $\pi$ and $\sigma$ are unitarily equivalent. Since unitary equivalence preserves characters, it is enough to treat the case $\sigma=\pi$ and $V_\sigma=V_\pi$. Applying [citetheorem:9715] to $\pi$ with the orthonormal basis $(e_i)_{i=1}^{d_\pi}$ gives
\begin{align*}
\int_G c_i^\pi(g)\overline{c_j^\pi(g)}\,d\mu_G(g)=\frac{1}{d_\pi}\delta_{ij}.
\end{align*}
Hence
\begin{align*}
\int_G \chi_\pi(g)\overline{\chi_\pi(g)}\,d\mu_G(g)=\sum_{i=1}^{d_\pi}\sum_{j=1}^{d_\pi}\frac{1}{d_\pi}\delta_{ij}=1.
\end{align*}
This proves the displayed orthogonality relation.
[guided]
The point of this step is that character orthogonality is matrix-coefficient orthogonality with the diagonal entries added up. The theorem [citetheorem:9715] applies because $\pi$ and $\sigma$ are continuous irreducible unitary finite-dimensional representations of the compact Lie group $G$, exactly as required in its hypotheses.
If $\pi$ and $\sigma$ are not unitarily equivalent, Schur orthogonality says that every matrix coefficient of $\pi$ is orthogonal in $L^2(G,\mu_G)$ to every matrix coefficient of $\sigma$. In particular, for each diagonal coefficient pair,
\begin{align*}
\int_G c_i^\pi(g)\overline{c_a^\sigma(g)}\,d\mu_G(g)=0.
\end{align*}
Since the characters are finite sums of these diagonal coefficients, we may expand the product and integrate term by term:
\begin{align*}
\int_G \chi_\pi(g)\overline{\chi_\sigma(g)}\,d\mu_G(g)=\sum_{i=1}^{d_\pi}\sum_{a=1}^{d_\sigma}\int_G c_i^\pi(g)\overline{c_a^\sigma(g)}\,d\mu_G(g)=0.
\end{align*}
Now assume $\pi$ and $\sigma$ are unitarily equivalent. A unitary equivalence $U:V_\pi\to V_\sigma$ satisfies $U\pi(g)=\sigma(g)U$ for all $g\in G$, so $\sigma(g)=U\pi(g)U^{-1}$. Trace is invariant under conjugation of linear endomorphisms, hence $\chi_\sigma(g)=\chi_\pi(g)$ for every $g\in G$. Thus it suffices to compute the $L^2$ norm of $\chi_\pi$.
Schur orthogonality for the same irreducible representation gives, for the diagonal coefficients,
\begin{align*}
\int_G c_i^\pi(g)\overline{c_j^\pi(g)}\,d\mu_G(g)=\frac{1}{d_\pi}\delta_{ij}.
\end{align*}
Therefore
\begin{align*}
\int_G |\chi_\pi(g)|^2\,d\mu_G(g)=\sum_{i=1}^{d_\pi}\sum_{j=1}^{d_\pi}\frac{1}{d_\pi}\delta_{ij}.
\end{align*}
Only the $d_\pi$ terms with $i=j$ survive, and each contributes $1/d_\pi$. Hence
\begin{align*}
\int_G |\chi_\pi(g)|^2\,d\mu_G(g)=1.
\end{align*}
This proves that irreducible characters from distinct unitary equivalence classes are orthogonal and that each has norm one.
[/guided]
[/step]
[step:Use Peter-Weyl to reduce completeness to the fixed part of each coefficient block]
Let $\widehat G$ denote a choice of one representative $(\tau,V_\tau)$ from each unitary equivalence class of irreducible finite-dimensional continuous unitary complex representations of $G$. For $\tau\in\widehat G$, define its coefficient space
\begin{align*}
\mathcal C_\tau:=\operatorname{span}_{\mathbb C}\{g\mapsto (\tau(g)v,w)_{V_\tau}:v,w\in V_\tau\}\subset C(G).
\end{align*}
By [citetheorem:8833], the [Hilbert space](/page/Hilbert%20Space) $L^2(G,\mu_G)$ is the Hilbert [direct sum](/page/Direct%20Sum) closure of the mutually orthogonal finite-dimensional spaces $\mathcal C_\tau$:
\begin{align*}
L^2(G,\mu_G)=\overline{\bigoplus_{\tau\in\widehat G}\mathcal C_\tau}.
\end{align*}
Let $\mathcal{L}(L^2(G,\mu_G))$ denote the space of bounded linear operators on $L^2(G,\mu_G)$. Define the conjugation action $U:G\to \mathcal{L}(L^2(G,\mu_G))$ by
\begin{align*}
(U_h f)(g):=f(h^{-1}gh)
\end{align*}
for $h,g\in G$ and $f\in L^2(G,\mu_G)$, with equality understood for $L^2$ classes. The Haar measure $\mu_G$ is invariant under inner automorphisms, so each $U_h$ is unitary. The class subspace is
\begin{align*}
L^2(G,\mu_G)^{\operatorname{class}}=\{f\in L^2(G,\mu_G):U_hf=f\text{ for every }h\in G\}.
\end{align*}
Each $\mathcal C_\tau$ is invariant under $U_h$, because if $c_{v,w}:G\to\mathbb C$ is defined by
\begin{align*}
c_{v,w}(g):=(\tau(g)v,w)_{V_\tau},
\end{align*}
then
\begin{align*}
(U_hc_{v,w})(g)=(\tau(g)\tau(h)^{-1}v,\tau(h)^{-1}w)_{V_\tau}.
\end{align*}
Thus the class subspace is the Hilbert direct sum closure of the fixed subspaces $\mathcal C_\tau^G:=\{c\in\mathcal C_\tau:U_hc=c\text{ for every }h\in G\}$.
[/step]
[step:Identify the conjugation-fixed vectors in one coefficient block]
Fix $\tau\in\widehat G$ and put $V:=V_\tau$. Let $\operatorname{End}_{\mathbb C}(V)$ be the complex [vector space](/page/Vector%20Space) of complex-linear endomorphisms of $V$. Define the [linear map](/page/Linear%20Map)
\begin{align*}
\Phi_\tau:\operatorname{End}_{\mathbb C}(V)&\to \mathcal C_\tau
\end{align*}
\begin{align*}
A&\mapsto \bigl(g\mapsto \operatorname{tr}(\tau(g)A)\bigr).
\end{align*}
The map $\Phi_\tau$ is surjective by the definition of $\mathcal C_\tau$ in terms of rank-one coefficient functions, and it is injective by Schur orthogonality of matrix coefficients in [citetheorem:9715]. Hence $\Phi_\tau$ identifies $\operatorname{End}_{\mathbb C}(V)$ with $\mathcal C_\tau$.
For $h\in G$ and $A\in\operatorname{End}_{\mathbb C}(V)$, cyclicity of trace gives
\begin{align*}
(U_h\Phi_\tau(A))(g)=\operatorname{tr}(\tau(g)\tau(h)A\tau(h)^{-1}).
\end{align*}
Therefore $\Phi_\tau(A)$ is fixed by every $U_h$ if and only if
\begin{align*}
\tau(h)A\tau(h)^{-1}=A
\end{align*}
for every $h\in G$. Equivalently, $A$ commutes with $\tau(h)$ for every $h\in G$.
By Schur's lemma for irreducible complex representations, applied to the irreducible representation $\tau$ on $V$, every such endomorphism is a scalar multiple of the identity endomorphism $I_V$; this is the only external algebraic result used here that is not being created in this same pipeline run. Hence
\begin{align*}
\mathcal C_\tau^G=\mathbb C\,\Phi_\tau(I_V)=\mathbb C\,\chi_\tau.
\end{align*}
[guided]
We now explain why a class function can only see the trace direction inside a single Peter-Weyl block. The coefficient block $\mathcal C_\tau$ is naturally the same as $\operatorname{End}_{\mathbb C}(V_\tau)$: an endomorphism $A:V_\tau\to V_\tau$ gives the coefficient-type function
\begin{align*}
\Phi_\tau(A):G\to\mathbb C,\qquad g\mapsto \operatorname{tr}(\tau(g)A).
\end{align*}
Rank-one endomorphisms produce the usual matrix coefficients, so $\Phi_\tau$ is surjective onto $\mathcal C_\tau$. The injectivity follows from [citetheorem:9715]: if $\Phi_\tau(A)=0$, then all matrix coefficients of $A$ have zero pairing with the coefficient functions of $\tau$, forcing all matrix entries of $A$ in an orthonormal basis to be zero. Thus $A=0$.
Next we compute how conjugation of the argument acts on this endomorphism model. For $h\in G$,
\begin{align*}
(U_h\Phi_\tau(A))(g)=\Phi_\tau(A)(h^{-1}gh)=\operatorname{tr}(\tau(h^{-1}gh)A).
\end{align*}
Because $\tau$ is a representation,
\begin{align*}
\tau(h^{-1}gh)=\tau(h)^{-1}\tau(g)\tau(h).
\end{align*}
Using cyclicity of trace, we obtain
\begin{align*}
\operatorname{tr}(\tau(h)^{-1}\tau(g)\tau(h)A)=\operatorname{tr}(\tau(g)\tau(h)A\tau(h)^{-1}).
\end{align*}
Therefore conjugating the argument of the coefficient function corresponds, under $\Phi_\tau$, to conjugating the endomorphism $A$ by $\tau(h)$:
\begin{align*}
U_h\Phi_\tau(A)=\Phi_\tau(\tau(h)A\tau(h)^{-1}).
\end{align*}
So $\Phi_\tau(A)$ is a class function exactly when
\begin{align*}
\Phi_\tau(\tau(h)A\tau(h)^{-1})=\Phi_\tau(A)
\end{align*}
for every $h\in G$. Since $\Phi_\tau$ is injective, this is equivalent to
\begin{align*}
\tau(h)A\tau(h)^{-1}=A
\end{align*}
for every $h\in G$, or equivalently $A\tau(h)=\tau(h)A$ for every $h\in G$.
Now Schur's lemma enters. Since $\tau$ is irreducible over $\mathbb C$, every complex-linear endomorphism commuting with all operators $\tau(h)$ is a scalar multiple of $I_V$. Thus the fixed part of the block corresponds exactly to the scalar line $\mathbb C I_V$. Applying $\Phi_\tau$ to this line gives
\begin{align*}
\Phi_\tau(\lambda I_V)(g)=\lambda\operatorname{tr}(\tau(g))=\lambda\chi_\tau(g).
\end{align*}
Hence
\begin{align*}
\mathcal C_\tau^G=\mathbb C\chi_\tau.
\end{align*}
This is the reason the character is the only surviving vector in the $\tau$-block after imposing conjugation invariance.
[/guided]
[/step]
[step:Conclude that irreducible characters form the Hilbert basis of class functions]
From the previous step,
\begin{align*}
L^2(G,\mu_G)^{\operatorname{class}}=\overline{\operatorname{span}_{\mathbb C}\{\chi_\tau:\tau\in\widehat G\}}.
\end{align*}
The orthogonality calculation already proved that
\begin{align*}
\int_G \chi_\tau(g)\overline{\chi_\eta(g)}\,d\mu_G(g)=\delta_{\tau\eta}
\end{align*}
for all $\tau,\eta\in\widehat G$. Therefore the irreducible characters form an orthonormal set whose closed linear span is exactly $L^2(G,\mu_G)^{\operatorname{class}}$. This is precisely the assertion that they form an orthonormal Hilbert basis of the class-function subspace.
[/step]