Proof

Since sgn is a multiplicative mapping, the sign of g is the product of the signs of every factor. Now a cycle of odd length has sign 1, so we only need to count the number of cycles of even length.