I'm self studying and came across the following problem that I'm having some trouble with.
If $G$ has order $p^2$, and $H$ is a subgroup of order $p$, then $H$ is normal in $G$.
I understand that this post shows a similar result. However, this is showing that $G$ contains some subgroup of order $p$ that is normal, not that the specific subgroup $H$ is normal. The concept of a center has not been formally introduced yet.
Here's my attempt.
Since $H$ has order $p$, it must be cyclic with generator $h$. Consider any $g \in G$. Let $a = g h g^{-1}$, and consider any $h^k \in H$. We want to show that $g h^k g^{-1} = (g h g^{-1})^k = a^k \in H$. Thus showing $\langle a \rangle = \langle h \rangle$ will prove the desired result.
Let $H_g = \langle h, a\rangle$. If $G \neq H_g$, then $H_g$ is a subgroup of order $p$ that contains both $a$ and $h$ so $H_g = \langle a \rangle = \langle h \rangle = H$. Thus $H$ is normal in $G$.
Now suppose $G = H_g$. In this case, we can write $g = a^{k_1} h^{k_2} \dots a^{k_m} $. I want maybe try to show by induction on the length of $g$ that $g \in H$.
Possibly on the right track? Any hints you can give? I've been struggling with this problem for a full week now.