Solution (source code)

= Solution

If $H$ is an <open subgroup>, each left <coset> $gH$ is open because left translation is a <homeomorphism> in a <topological group>. Its complement is the union of all the other <cosets>,
$$
G\setminus H=\bigcup_{g\notin H}gH.
$$
This is open, so \b[$H$ is closed]. No <compactness> or separation assumption is required.