If $G$ is a finite $p$-group and $H\neq 1$ is normal in $G$, then $H\cap Z(G)\neq 1$
I know that there is an answer here but it uses composition series.
My teacher gave me the following hint:
$$G = Z(g)\cup (\cup G_{x_i})$$
and to see $H$ as
$$|H| = |H\cap Z(G)| + \cdots$$
I think it has something to do with the class equation. If we let $G$ act on $H$ by conjugation, I know that the class equation becomes:
$$|H| = |\{h | ghg^{-1}=h\}| + \sum_{i}|\{gh_ig^{-1}| g\in G\}| = \\ |\{h \ | \ gh = hg\}| + \sum_{i}|\{gh_ig^{-1}| g\in G\}| = Z(G) + \sum_{i}|G_{x_i}| = Z(G) + \sum_{i}(G:G_{x_i})$$
(the last equality I'm just guessing... Shouldn't it have something to do with $H$?)
I also feel that the conclusion should follow from $|H|$ being $>1$ and divisibility, but I'm not quite sure. Could somebody help me and also verify if my class equation is right?