When can the basis of a Lie algebra always be made Hermitian? In Zee's book Group Theory in a Nutshell for Physicists, Chapter VI.3, it is stated that (quoted contents are in italic):
Consider a general Lie algebra with $n$ generators defined by
$$
[X^a, X^b] = i {f^{ab}}_c X^c 
\tag{1}
$$
A footnote says that here we only discuss the algebras of compact Lie groups. On the next page, Zee argues that the structure constants should be real:
Hermiticity of $X^a$ implies that the ${f^{ab}}_c$ are real.
A few pages later, after converting to the Cartan-Weyl basis $H^i, E_\beta$ for which
$$
[H^i, E_\beta] = \beta^i E_\beta
\tag{16}
$$
Zee again assumes that $H^i$ are Hermitian to show that if $\beta$ is a root vector, so is $-\beta$. So my questions are:
Can the generators $\{X^a\}$ of a Lie algebra, or the $\{H^i\}$ in the Cartan-Weyl basis (or the representation matrices of them) always be made Hermitian? Are there any restrictions (e.g. compact, semi-simple, connected etc) on the Lie group to make this true? Please kindly provide references to related theorems.
(I am a physics student, and I apologize if my statements are not clear or rigorous enough.)
 A: To write things in mathematical language and notation here, we are considering an $n$-dimensional matrix Lie algebra $\mathfrak{g} \subseteq \mathfrak{gl}_d(\mathbb{C})$ (to a mathematician a "general Lie algebra" would not come equipped with such an embedding, and "$n$ generators" would mean something quite different). The question is when up to conjugacy such a Lie algebra can be chosen to lie in the unitary Lie algebra $\mathfrak{u}(d)$ of skew-Hermitian matrices (to get Hermitian matrices we need to multiply everything by $i$ all the time which is annoying and I don't recommend doing it; that's where the factor of $i$ in the first expression comes from).
The answer is that $\mathfrak{g}$ needs to be compact in the sense that it integrates to a compact subgroup $G \subseteq GL_d(\mathbb{C})$ (this is slightly different from what "compact Lie algebra" means abstractly; this is the precise meaning of Zee's footnote). When this is true we can apply the unitary trick, starting with the standard inner product on $\mathbb{C}^d$ and averaging it over $G$ with respect to Haar measure to get a $G$-invariant inner product, which (after finding an orthonormal basis of this new inner product) conjugates $G$ into the unitary group $U(d)$ and hence which conjugates its Lie algebra into the unitary Lie algebra.
