Prove that if $G$ is a finite group with an even class number, then $G$ is of even order. Give an example that the converse fails. 
Prove that if $G$ is a finite group with an even class number (the number of conjugacy classes of a group $G$ is called its class number) then $G$ is of even order. Give an example that the converse fails.

My attempt: If $n$ is even $$|G|=\sum_{i=1}^{n} |{\rm orb}(g_i)|$$
and for all $i$, $|{\rm orb}(g_i)|$ divides $|G|$. Let $a,b_i$ be integers. Does
$$a=\sum_{i=1}^{n \text{ even } }b_i$$ with $b_i\mid a$ $\forall i$ imply that $a$ is even?
Actualization: By contradiction, if $a$ is odd, $b_i\mid a$ implies $b_i$ is odd. Because odd+odd=even then $a$ is even a contradiction.
What counterexample can be work?
 A: This can be solved with character theory. Let $\chi \in Irr(G)$, with $\chi \neq 1_G$ (the principal character). Apply the orthogonality relation to $\chi$ and $1_G$, then
$$\sum_{x \in G}\chi(x)=0.$$
Now assume that $\chi$ is real-valued. Then $\chi(x)=\overline{\chi(x)}$ (complex conjugate) for all $x \in G$. From the orthogonality formula above one has
$$\chi(1)=-\sum_{x \in G-\{1\}}\chi(x).$$
But $\chi(1) \mid |G|$, so the degree of $\chi$ is odd. The oddness of $|G|$ also implies that for all $x \in G-\{1\}$, $x\neq x^{-1}$, so
$$\sum_{x \in G-\{1\}}\chi(x)=\sum \chi(x)+\chi(x^{-1}),$$
where the last sum is taken over a set of disjoint pairs $\{x,x^{-1}\}$. Now $\chi(x)$ is the sum of the eigenvalues of a matrix representing $x$, while $\chi(x^{-1})$ is the sum of the eigenvalues of the inverse of that same matrix. The eigenvalues of the matrix are roots of unity and for a root of unity $\zeta$, one has $\zeta^{-1}=\overline{\zeta}$. Since $\chi$ is real-valued one must have $\chi(x)=\chi(x^{-1})$. It follows that
$$\frac{1}{2}\chi(1)=-\sum_{x}\chi(x).$$
We now have a contradiction: the left hand is half an odd positive integer, while the right hand side is an algebraic integer.
Hence we have shown that if $|G|$ is odd, and $\chi \in Irr(G)$ is not principal, then $\overline{\chi} \neq \chi$. It follows that the number of irreducible characters, which is the same as the number of conjugacy classes is odd.
Counterexample for the reverse $G=Q$, the quaternion group of order $8$, it has $5$ conjugacy classes.
A: Here is a much simpler solution based on the class equation. Assume that $|G|$ is odd, then since $|Z(G)| \mid |G|$, also $|Z(G)|$ is odd and for $g \in G$ also $\#Cl_G(g)=|G:C_G(g)|$ is odd. The class equation gives
$$|G|=|Z(G)| + \sum_{g_i \notin Z(G)} \#Cl_G(g_i)$$
for certain non-central $g_i \in G$. Write $k(G)$ for the number of conjugacy classes. Taking the equation mod $2$ at both sides yields
$$1 \equiv 1 +(k(G)-|Z(G)|) \text { mod 2},$$
hence $k(G) \equiv |Z(G)| \equiv 1 \text { mod } 2$. So if $|G|$ is odd then $k(G)$ is odd. A counterexample to the reverse is $G=S_3$, which has $ k(G)=3$.
Note One can even prove the following congruence (and this is a theorem of Burnside which he proved with the help of character theory, but also can be shown without (even improvements and variations, see here.)) 
Theorem If $|G|$ is odd, then $|G| \equiv k(G) \text { mod } 16$.
A: I think the proof of the first part by contradiction is easier than anything yet proposed.
Since the size of each conjugacy class is a divisor of the order of the group, if the group has odd order then each class must have odd size (the group order has no even divisors). Since an even number of sets of odd size would have an even number of elements, and the group has odd order, there cannot be an even number of classes.
Therefore, if the number of classes is even, the group cannot have odd order, so in this case the order must be even.
