Inverting without actual inverse? I'm reading Ash's "Basic Abstract Algebra" and been trying to understand the following: 



For which I guess the problem lies when we try to take an element $hk\in HK$, it's inverse is $k^{-1}h^{-1}$ but $k^{-1}h^{-1}\in HK$ only if $k^{-1}h^{-1}=h^{-1} k^{-1}$. 
My problem is the following, taking the definition of subgroup, we have:


*

*If $a,b\in H$, then $ab^{-1}\in H$. 


Then, all the elements $k\cdot1=k$ and $1\cdot h=h$ are in $HK$, that is: We have all the elements of both $H,K$ in $HK$. By the definition, suppose we have $hk\in HK$, then we must have $(hk)(k^{-1})$ and $(hkk^{-1})(h^{-1})$. Isn't this very similar to having the inverse of $hk$ in $HK$? 
It's a bit odd because it seems we can actually invert $hk$ by performing the two operations I mentioned before but $(hk)^{-1}$ is not actually in $HK$.
 A: $\newcommand{\Span}[1]{\left\langle #1 \right\rangle}$Allow me first of all to question your statement

when we try to take an element $hk\in HK$, its inverse is $k^{-1}h^{-1}$ but $k^{-1}h^{-1}\in HK$ only if $k^{-1}h^{-1}=h^{-1} k^{-1}$.

This is not true. Take for instance $G = S_{3}$, $H = \Span{(1 2)}$, $K = \Span{(1 2 3)}$, $h = (1 2)$, $k = (1 2 3)$. Then $h^{-1} k^{-1} = (2 3) \ne (1 3) = k^{-1} h^{-1} \in H K = S_{3}$.
As to your second statement

suppose we have $hk\in HK$, then we must have $(hk)(k^{-1})$ and $(hkk^{-1})(h^{-1})$. Isn't this very similar to having the inverse of $hk$ in $HK$? 

I fail to see the point. Sure, $h k$ has an inverse $k^{-1} h^{-1}$ in $G$, and that's what you are checking. But to show that $H K$ is a subgroup you will have to show that (under suitable conditions) this inverse lies precisely in $H K$.
A: Assume $HK = KH$. To show that $HK$ is a subgroup, consider $g_1= h_1k_1, g_2 = h_2k_2$ in $HK$. We have $(k_1k_2^{-1})h_2^{-1} \in KH = HK$, hence $(k_1k_2^{-1})h_2^{-1} = hk$ with $h \in H, k \in K$. Then $g_1g_2^{-1} = h_1k_1k_2^{-1}h_2^{-1} = h_1hk \in HK$.
If you consider $hk \in HK$, then you see even easier $(hk)^{-1} = k^{-1}h^{-1} \in KH = HK$.
Conversely, assume that $HK$ is a subgroup of $G$.
(a) $KH \subset HK$.
Let $g \in KH$. Write $g = kh$ with $h \in H, k \in K$. Then $g^{-1} = h^{-1}k^{-1} \in HK$, hence $g \in HK$. 
(b) $HK \subset KH$.
Let $g \in HK$. Then also $g^{-1} \in HK$, hence $g^{-1} = hk$ with $h \in H, k \in K$. This shows $g = k^{-1}h^{-1} \in KH$.
