prove that the union of two subgroups is a subgroup iff one is contained in other 
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.
 A: We will prove that
$(1)\quad K\cup H $ is a subgroup $\implies K\subset H \lor H\subset K$
By contradiction
$ (H\not\subset K)\land (K\not\subset H) \iff \left\lbrace\begin{array}l \exists h\in H\backslash K \\\exists k\in K\backslash H \end{array}\right.$
Let $u= k*h\in K\cup H$
$k*h\in K\cup H \implies \left\lbrace \begin{array}l k*h\in K\implies k^{-1}*k*h\in K\implies h\in K \quad\text{contradiction}\\\text{or}\\k*h\in H\implies k*h*h^{-1}\in H\implies k\in H \quad\text{contradiction}\end{array}\right.$
So $K\cup H $ is a subgroup $\implies K\subset H \lor H\subset K$
$ (2)\quad K\subset H \lor H\subset K \implies $ $K\cup H $ is a subgroup is obvious
A: I think any such proof would revolve around the same ideas. But here's how we can phrase it to stay close enough to your original proof.
After

… we have to prove $H\subset K$ or $K\subset H$

we can insert the following: If $H\subset K$, we're done. So let's assume that $H\not\subset K$ (in which case our goal is to show that $K\subset H$). Then instead of

Let $x\in H$

it's better to pick $x\in H\setminus K$. Now we can pick any $y\in K$, as you did. And as in your proof (but I just want to give a name to the new element):

Then $z=x*y\in H\cup K$ for $H\cup K$ is a subgroup $\implies$ $x*y\in H$ or $x*y\in K$.

If $z=x*y\in K$, then $x=zy^{-1}\in K$, since both $z\in K$ and $y^{-1}\in K$. But this is impossible because we chose $x\in H\setminus K$. Therefore $z=x*y\in H$. But then $y=x^{-1}z\in H$, since both $x^{-1}\in H$ and $z\in H$.
Thus we've shown that for any element $y\in K$, we have $y\in H$, i.e. $K\subset H$.
