Let $H$ and $K$ be two subgroups of a group $G$. Then $H \cup K$ is a subgroup $\iff H\subset K$ or $K \subset H$.
My proof: (probably contain errors)
If one subgroup is a subset of other then $H\cup K$ is a subgroup. The proof of this implication is easy.
Now if $H\cup K$ is a subgroup, we have to prove $H\subset K$ or $K \subset H$.
Let $x\in H$ and $y\in K$
Then $x*y \in H \cup K$ for $H \cup K$ is a subgroup.
$\implies x*y \in H $ or $x*y \in K$
$\implies y\in H $ or $ x \in K$
If $y\in H$, then $K\subset H$. If $y \notin H$, then $x \in K$ which implies $H \subset K$
$\therefore$ $H\subset K$ or $K \subset H$.
I know that this proof is wrong. Please help me improve the proof. Suggestions and hints are welcomed. Preference is given to direct proof which uses only the elementary properties of a group (proof which help me to improve the proof I had written) but proof by contradictions are also okay. Thanks in advance.