I want to prove the following. Let $G$ be a compact connected Lie group with Lie algebra $\mathfrak g$ and center $Z_G.$ It is not hard to prove that $\mathfrak g$ is reductive. Therefore, we can decompose $\mathfrak g=Z_{\mathfrak g}\oplus[\mathfrak g,\mathfrak g]$ as direct sum of ideals where $[\mathfrak g,\mathfrak g]$ is semisimple. Let $G_{SS}$ be the analytic subgroup of $G$ with Lie algebra $[\mathfrak g,\mathfrak g].$ Then we have $G=(Z_G)_0G_{ss}$ where $(Z_G)_0$ is the identity component of $Z_G.$ I am reading "Lie Groups Beyond Introduction" by Knapp where the following argument is given. Choose covering groups $\widetilde{G_{ss}}$ of $G_{ss}$ and $\widetilde{(Z_G)_0}$ of $(Z_G)_0$ respectively. Then $\widetilde{G_{ss}}\times\widetilde{(Z_G)_0}$ is a covering group of $G_{ss}\times Z_G$ with Lie algebra $Z_{\mathfrak g}\times [\mathfrak g,\mathfrak g]$ which is isomorphic to $\mathfrak g.$ Therefore, we must have $\widetilde{G_{ss}}\times\widetilde{(Z_G)_0}$ is a covering group of $G.$ I understand till this point. But it seems that from this one can prove at once what I have proposed. How is it so?