For groups $K$ and $H$, let $K \times H$ denote the product group. Let $G_1 = \{(x,e) | x \in K\} \subseteq K \times H$ and $G_2 = \{(e,y) | y \in H\} \subseteq K \times H$.
Show that $G_1$ and $G_2$ are subgroups of $K \times H$.
I tried using the subgroup test, to show that $\forall x,y \in G_1, xy^{-1} \in G_1$ but I'm not too sure how I'd compose the ordered pairs.
In other words, $(x_1,e)(x_2,e) \in G_1$ implies $(x_1,e)(x_2,e)^{-1} \in G_1$ but how might I calculate that and show this?
I used $(x_1,e)(x_2,e)^{-1} = (x_1x_2^{-1},e)$ and we need to show $x_1x_2^{-1} \in K$
Without loss of generality, consider only $G:=G_1\subseteq K\times H$.
Like you have started, I will apply the one-step subgroup test.
Since $(e,e)\in G$ as $e\in K$, we have $G\neq \varnothing$.
Let $x,y\in G$. Then there exist $a,b\in K$ such that $x=(a,e), y=(b,e)$.
The multiplication of $K\times H$ is componentwise, meaning $(k, h)(k',h')=(kk', hh')$ for all $k,k'\in K, h,h'\in H$; therefore:
$$\begin{align} xy^{-1}&=(a,e)(b,e)^{-1}\\ &=(a,e)(b^{-1}, e^{-1})\\ &=(ab^{-1}, ee)\\ &=(ab^{-1}, e), \end{align}$$
but $ab^{-1}\in K$ since $K$ is a group. Thus $xy^{-1}\in G$.
Hence $G\le K\times H$.