My teacher defined:
Given a topological group $G$ and a topological space $X$, define $H^G(X):=[X,G]$, the set of homotopy classes of maps from $X$ into $G$. Then, in this case, we can endow $H^G(X)$ with a structure of a group, as follows: given two continuous maps $f,g:X\to G$, define $(f\cdot g):X\to G$ by $(f\cdot g)(x)=f(x)\cdot g(x),\forall x\in X$. Since $G$ is a topological group, one can show that $(f\cdot g):X\to G$ is continuous and, then, we can take the homotopy class $[f\cdot g]\in H^G(X)$. Furthermore, $[f]\cdot [g]=[f\cdot g]$ gives a well defined operation in $H^G(X)$, under which it becomes a group.
After that, among others, he gave us the following exercise:
Let $G$ be a topological group and $X,Y$ be topological spaces. Show that $H^G(X\times Y)\cong H^G(X)\times H^G(Y)$, where $H^G(X)\times H^G(Y)$ is the direct product of $H^G(X)$ and $H^G(Y)$.
It seems like a kind of "Künneth formula". What I have tried:
Supposing that $X\times Y\neq \emptyset $, fix $(x_0,y_0)\in X\times Y$. Then $f:X\times Y\to G$ is continuous. Let $[f]\in H^G(X\times Y)$ be given. Define $f_X:X\to G$ and $f_Y:Y\to G$ by $f_X(x)=f(x,y_0),\forall x\in X$ and $f_Y(y)=f(x_0,y),\forall y\in Y$. Then, since $f$ is continuous, so are $f_X$ and $f_Y$. Then I've defined $$\begin{array}{cccc}\mathscr{I}:&H^G(X\times Y)&\to&H^G(X)\times H^G(Y)\\ &[f]&\mapsto&([f_X],[f_Y]).\end{array}$$
I was able to show that this gives a well defined homomorphism from $H^G(X\times Y)$ into $H^G(X)\times H^G(Y)$, but I couldn't, for instance, to show it is injective. (Didn't try to show it is onto yet, but also does not seems obvious to me how to do it...)
Edit: In the case that $G=S^1$ with the complex numbers product, $H^G(X)$ becomes $H^1(X)$, the first cohomology group of $X$.
Edit 2: As Jeremy has noted in the comments, it must be some missing condition for this problem. Take $X=Y=\{p\}$ the point space and $G$ any nontrivial discrete topological group. Then $H^G(X\times Y)$ and $H^G(X)\times H^G(Y)$ do not have the same cardinality...