TITLE: Is the map from a group to its center a group homomorphism?
QUESTION [8 upvotes]: Is the map $f: G \rightarrow Z(G)$ where $f$ maps elements not in the center to the identity and is the identity map restricted to the center.
I think it is by my computation, but I just want to make sure. Could anyone confirm it for me?
Thanks!

REPLY [2 votes]: By your definition of $f$ $$|\ker f|=|Z(G)|+1$$  
So every group $G\quad \text{s.t}\quad |Z(G)|+1\nmid |G|$ is a counterexample .