Q:

The gender of 子

Is 子 ever used to refer to a boy, or is it always used for girls?  Is 悪い子 used only for girls? 

A:

Yes, 悪い子 can be used for boys.  
子 means "child", and it can refer to girls or boys depending on the context.