I have tried to prove the following problem:
Suppose $G$ is a connected matrix Lie group. Then the center of $\mathfrak{g}$ which is $\ker \textrm{ad}$ is equal to the Lie algebra of $Z(G)$.
Recall that $\textrm{ad} : \mathfrak{g} \to \text{gl}(\mathfrak{g})$ is the map that sends $X \in \mathfrak{g}$ to $\textrm{ad}_X$, where $\textrm{ad}_X$ is defined by
$\textrm{ad}_X(Y) = [X,Y].$ Similarly $\textrm{Ad}_A$ is the map such that for all $X \in \mathfrak{g}$, we have $\textrm{Ad}_A(X) = AXA^{-1}$. Now I have proven the problem above as follows: If $Y \in \ker \textrm{ad}$, then certainly for all $t \in \Bbb{R}$ we have $\textrm{ad}_{tY} = 0$. Now we have given any $x \in G$ that
$\begin{eqnarray*} e^{tY}xe^{-tY} &=& \textrm{Ad}_{e^{tY}}(x) \\ &=& e^{\textrm{ad}_{tY}}(x) \\ &=& x \end{eqnarray*}$
by assumption and since this holds for all $x$, we conclude that $e^{tY} \in Z(G)$ for all $t$ and so $Y$ is in the Lie algebra of $Z(G)$.
For the converse, if $Y$ is in the Lie algebra of $Z(G)$, then $e^{tY} \in Z(G)$ for all $t$ and so given any $x \in G$, $e^{tY}xe^{-tY} = x$. We now have $e^{\textrm{ad}_{tY}}x =x$ for all $x$, which implies that $e^{\textrm{ad}_{tY}} = I \in \textrm{GL}(\mathfrak{g})$. Taking the derivative at $t = 0$ implies that $\textrm{ad}_Y = 0$ and so $Y \in \ker \textrm{ad}$.
However: I have nowhere used the assumption of connectedness of $G$. What have I done wrong?