If g∈Z(G), it commutes with each x∈G, so x−1gx=g. Its conjugacy class is therefore C(g)={g}.
Conversely, if C(g)={g}, then x−1gx=g for every x. Multiplication by x on the left gives gx=xg for every x, which is exactly membership in the center of a group. Thus