Any finite product of topological groups is a topological group with the direct product group structure and the product topology.
I was wondering why "finite"-ness was needed. My proof is as follows:
Let $\{G_i\}$ be a family of topological groups, with $\mu_i:G_i \times G_i \rightarrow G_i$, $n_i:G_i \rightarrow G_i$ be the multiplication and inverse map. Then define $\prod G_i$ with the direct group product structure and product topology.
The map $\mu = (\mu_i): \prod (G_i \times G_i) \rightarrow \prod G_i $ is continuous, and $n =(n_i) : \prod G_i \rightarrow \prod G_i$ is continuous too. (*) As $\prod G_i \times \prod G_i \cong \prod (G_i \times G_i)$, the multiplication map is continuous.
In $(*)$ I used the fact that if $f_i:X _i \rightarrow Y_i$ is a family of continuous maps, then $$ (f_i): \prod X_i \rightarrow \prod Y_i, \quad \text{ where } (f(x))_i = f_i(x_i)$$ is a continuous map. Let $\prod U_i$ be an open basis element $(U_i =Y_i$ for all but finitely many $i$), then $(f_i)^{-1}(\prod U_i) = \prod f_i^{-1}(U_i)$ is also an open basis element of $\prod X_i$.
Note: $i$ ranges in an arbitrary index set $I$.