Product of compact and closed in topological group is closed
Solution 1:
Let $ x\in G\setminus BA $. Then $B^{-1} x \cap A =\emptyset$, and $B^{-1} x$ is closed. since $A$ is compact there exists a neighborhood $U$ of $e$ such that $$B^{-1} xU\cap AU=\emptyset. ^{*}$$ But this implies that $xUU^{-1} \cap BA=\emptyset$. Since $xUU^{-1}$ is a neighborhood of $x$ not meeting $BA$, it follows that $BA$ is closed, since $x$ is arbitrary.
Similarly, $AB$ is closed.
*. Let $B$ be a closed subset and $A$ a compact subset of a topological group $G$ such that $A\cap B=\emptyset.$ Then there exists a neighborhood $U$ of $e$ such that:
$AU\cap BU=\emptyset$
$UA\cap UB=\emptyset.$
Sketch of proof: by compactness, there are some $a_1,\ldots,a_n$ and neighbourhoods $V_1,\ldots,V_n$ of $e$ such that $a_iV_i^2\cap B=\emptyset$ and $\bigcup_i a_iV_i\supseteq A$. Then for any $a\in a_iV_i$ you have that $aV_i\subseteq a_iV_i^2$, so $V=\bigcap_i V_i$ satisfies $AV\cap B=\emptyset$. Then find some $U\subseteq V$ symmetric such that $U^2\subseteq V$. Then $\emptyset=AV\cap B\supseteq AU^2\cap B$, so $AU\cap BU=AU\cap BU^{-1}=\emptyset$.