Let $G$ be a Lie group and $\mathfrak{g}$ its Lie algebra.
The adjoint representation of the Lie algebra $\mathfrak{g}$ is defined as:
$$ \text{ad: } \mathfrak{g} \rightarrow \text{End}(\mathfrak{g}), X \mapsto [X,\cdot] $$
Now, it holds true that
$$ \text{ker ad} = \mathfrak{z}(\mathfrak{g}) = \{X \in \mathfrak{g} : [X,Y] = 0 \quad\forall\; Y \in \mathfrak{g}\}.$$
On the other hand, the definition of the kernel of this homomorphism is (at least in my mind)
$$ \text{ker ad} = \{ X \in \mathfrak{g} : [X,\cdot] = \text{id}, \text{ i.e. } [X,Y] = Y \quad \forall \;Y \in \mathfrak{g} \}, $$
since the group identity in the endomorphism group is the identity-map.
Evidently, the two sets are not the same, but where is my mistake?
Best Answer
As KotelKanim mentionned in the comments, the adjoint homomorphism is a Lie algebra homomorphism, and as such, the kernel is the preimage of the zero vector. The second "definition" of the kernel you gave is what you would expect if Lie algebras were groups - which is not the case. So that much is settled.
Let me just point out two facts: