First, your own question to give me some clarity:
I am asking if someone could post a counterexample to the following problem and explain to me their thought process. This would help me so much.
Problem: Give an example of two subgroups $H$ and $K$ of a group $G$ whose union $H\cup K$ is not a subgroup of $G$.
Here is my thought process:
I need to find a group, $G$, big enough to have two different subgroups.
I need to make sure that I don't have $H \subset K$ lest $H \cup K = K$, a subgroup of $G$.
Similarly, I must avoid $K \subset H$.
Okay: the symmetries of a triangle give rise to the group $S_3$, which has six elements. This example comes to mind because it is a bit weird among the small groups; for example, it is the smallest nonabelian group. Also, it is has a bunch of subgroups that I sort of remember.
Once I have this example in mind, I know the concerns above about picking subgroups with one contained in the other can be avoided. My strategy now would be either to pick two of the fold groups (the ones represented by switching two vertices of a triangle) and checking to see if that messes up closure or set size, or to pick one fold group and one spinning group (the three element rotation group isomorphic to $\mathbb{Z}/3\mathbb{Z}$) and then see if that messes up closure or set size.
When I say set size, I do mean, in particular, that a group's order is divisible by the order of any of its subgroups (i.e., Lagrange's Theorem).
Okay: Let's give it a shot using the latter idea. We take the group with three elements (the rotations) and another group with two elements (a fold); let us see if we can mess up group size. Each of these groups contains only the identity in their intersection, so their union would have $3+2-1 = 4$ elements (three in the first group; two in the second group; but we have double-counted the identity, so we subtract one).
But now our union of subgroups has $4$ elements, which does not divide the order of $S_3$, i.e., $6$. So the union being a subgroup would contradict Lagrange's Theorem, and we are done.
In retrospect, I might check to see what would have happened with closure using the subgroups we ended up picking. Alternatively, I might take a shot at the other idea: Picking two of the fold groups and seeing if their union messes up group size (no, the union has $2 + 2 - 1 = 3$ elements, which divides $|S_3| = 6$) or closure. (A quick check reveals that, indeed, closure is a problem for both the subgroup we picked and any two of the fold groups; so counterexamples abound!)