Union of more than $2$ subgroups can be a subgroup for some group Actual Question  is :

Suppose $H$ and $K$ are subgroups of a group $G$ such that $H\cup K$ is a subgroup of $G$. Prove that either $H\subseteq K$ or $K\subseteq H$

I could do this just by assuming that I have  $h\in H; h\notin K$ and $k\in K; k\notin H$ then I would definitely have $hk\in H\cup K$ so $hk$ would be in either $H$ aor $K$ in any case it makes a contradiction.
Now the very next Question is :

Show that for each integer $n\geq 3$ there exists a group $G$ with subgroups $H_1,H_2,\cdots,H_n$ such that no $H_i$ is contained in any other and such that $H_1\cup H_2\cup \cdots \cup H_n$ is a subgroup of $G$.

I guess we have to construct some group for given $n\geq 3$
For some reason for $n=3$ I have the following idea : 
$n=3$ so there would be three subgroups and no subgroup is contained in any other..
Each subgroup must have atleast $1$ non identity element so there are $3$ non identity elements adding up identity element i would get $4$ elements.
It would be extra ordinary if my choice of group is just of $4$ elements.
It would not be a wise choice if i choose my group to be cyclic so only choice i have is  $\mathbb{Z}_2\times \mathbb{Z_2}=\{(0,0),(1,0),(0,1),(1,1)\}$
Each element is of $\mathbb{Z}_2\times \mathbb{Z_2}$ is of order $2$ so I would just take $H_1=\{(0,0),(1,0)\};H_2=\{(0,0),(0,1)\};H_3=\{(0,0),(1,1)\}$
So, I have $H_1\cup H_2\cup H_3$ to be whole group (which is More than sufficient)... I just need it to be a subgroup and it has become the whole group..
Now I got a group in which union of $3$ subgroups is a subgroup..
I have  one more example for the case of $n=3$ - Quaternion Group
$H_1=\{\pm 1,\pm i\}; H_2=\{\pm 1,\pm j\};H_3=\{\pm 1,\pm ij\}$
Here also I have $H_1\cup H_2\cup H_3=\{\pm 1,\pm i,\pm j,\pm ij\}$ Which is a subgroup of $G$ and more over it is the whole group.
Now I have got another Question : 
Is this just by chance that union of three proper subgroups is whole group of there are some examples in which union of three proper subgroups is a proper subgroup... I could not see this immediately 
I really have no idea how to go with $n=4$ and so on...
Please help me to see some way with this problem...
Thank you.
 A: Derek Holt and Wei Zhou answered the question:

Show that for each integer $n\geq 3$ there exists a group $G$ with subgroups $H_1,H_2,\cdots,H_n$ such that no $H_i$ is contained in any other and such that $H_1\cup H_2\cup \cdots \cup H_n = G$.

(The original question specifies the union be a subgroup, but there is no loss in taking $G$ itself to be that subgroup.)
The idea is to take some smaller group $K$ that is the union of $n-1$ subgroups $K_1$, $K_2$, $\dots$, $K_{n-1}$, and then form $G=K \times L$ for some non-identity group $L$. Take $H_1=K_1 \times L$, $H_2=K_2 \times L$, $\dots$, $H_{n-1} = K_{n-1} \times L$ and $H_n = K \times 1$. You can verify that $H_n \not\subset H_i$ (since $H_i$ does not contain every $(x,1)$ for $x \in K$) and $H_i \not\subset H_n$ (since $H_n$ does not contain $(1,x)$ for any $1\neq x \in L$).
However, Praphulla Koushik was understandably confused since $G$ was also the union $H_1 \cup \dots \cup H_{n-1}$, the last $H_n$ was redundant. I don't address the existence of non-redundant unions (or “coverings”) of size $n$, but I do address the minimal size of a covering:

Let $\sigma(G)$ be the least $n$ such that $G$ is the union of $n$ proper subgroups.

Clearly $\sigma(C_n) = \infty$ but otherwise for a finite group $G$, $\sigma(G)$ is finite. The obvious generalization is:

Show that for each integer $n$ there exists a group $G$ with $\sigma(G)=n$.

However, Cohn (1994) conjectured this was impossible for $n=7$, and Tomkinson (1997) proved this. Tomkinson also gave a formula for $\sigma(G)$ when $G$ is solvable: $\sigma(G)=[H:K]$ where $H/K$ is a the smallest chief factor with more than one complement.
We say that a group $G$ is $\sigma$-primitive if $G$ has no non-identity normal subgroup $N$ with $\sigma(G)=\sigma(G/N)$. In some sense, the $\sigma$-primitive groups are the only interesting ones (as the others just have $N \leq \cap H_i$ so the $N$ part could have been ignored).
As a standard exercise, $\sigma(G)\leq 2$ is impossible.
Cohn found the $\sigma$-primitive groups $G$ with $\sigma(G)=3$: only $C_2 \times C_2$, the same group Praphulla Koushik deduced. He also handled $\sigma(G)=4$: only $C_3\times C_3$ and $S_3$, and $\sigma(G)=5$: only $A_4$. Notice each of these is of the form $p^a+1$ for $p$ prime and $a$ positive. The first number $\geq 3$ not of this form is $7$, and it is not a $\sigma$-number. Current research involves studying the structure $\sigma$-primitive groups and finding $\sigma(G)$ for groups $G$ known to be $\sigma$-primitive. Detomi–Lucchini (2008) gives a good indication on the structure, and several papers compute $\sigma$ for (usually finitely many) simple groups.
Bibliography


*

*Cohn, J. H. E.
“On $n$-sum groups.”
Math. Scand. 75 (1994), no. 1, 44–58. 
MR1308936

*Tomkinson, M. J.
“Groups as the union of proper subgroups.”
Math. Scand. 81 (1997), no. 2, 191–198.
MR1613772

*Detomi, Eloisa; Lucchini, Andrea.
“On the structure of primitive n-sum groups.”
Cubo 10 (2008), no. 3, 195–210.
MR2467921
A: Suppose you have a "$k$"-example: $G=A_1 \cup \cdots \cup A_k$, where $A_i <G$. Let $H$ be a group isomorphic to $G$, then there exists $B_1 \le H$ and $B_1 \cong A_1$. Now consider the group $X=G \times H$. Clearly $X=A_1 \times H\cup \cdots \cup A_k \times H$. Let $X_i=A_i \times H$. So $X=X_1 \cup \cdots X_k$. Let $X_{k+1}=G \times B_1$. Now you can find that $X, X_1, \cdots,  X_{k+1}$ is a "$k+1$"-example. So if $k$ is right, then $k+1$ is right.
A: As was noted, a group cannot be the union of two of its proper subgroups. It might be interesting to know, that research has been done on how this might generalize. Berci gave you an example based on the Klein 4-group. In fact more is true: 
Theorem (Bruckheimer, Bryan and Muir) A group is the union of three proper subgroups if and only if it has a quotient isomorphic to $C_2 \times C_2$.
The proof appeared in the American Math. Monthly $77$, no. $1 (1970)$. The theorem seems to be proved earlier by the Italian mathematician Gaetano Scorza, I gruppi che possono pensarsi come somma di tre loro sottogruppi, Boll. Un. Mat. Ital. $5 (1926), 216-218$.
 For 4, 5 or 6 subgroups a similar theorem is true and the Klein 4-group is for each of the cases replaced by some finite set of groups. For 7 subgroups however, it is not true: no group can be written as a union of 7 of its proper subgroups. This was proved by Tomkinson in 1997.
There is a nice overview paper by Mira Bhargava, Groups as unions of subgroups, The American Mathematical Monthly, $116$, no. $5, (2009)$.   
