Here's the problem:
Suppose $G$ is a group and $H$ is a maximal subgroup of $G$. Show that either $Z(G) \leq H$ or $G' \leq H$.
I know that if $G$ is abelian, then $G = Z(G)$, $G' = \{e\}$, and $G' \leq H$.
Furthermore, if $G$ is not abelian but $H$ is abelian, then $Z(G) \leq H$, because otherwise the subgroup $\langle Z(G), H \rangle$ would be an abelian subgroup of $G$ that contains $H$, and because of the maximality of $H$, is equal to $G$, contradicting the fact that we took $G$ to be non-abelian.
I'm unsure of what happens when both $G$ and $H$ are non-abelian. Any hints would be appreciated!