How can I show that $\langle X,\Omega^2 K\rangle$ is abelian?
Here $X$ and $K$ are topological spaces with basepoints $x_0$ and $k_0$, respectively. The loopspace $\Omega^2 K$ is the set of all maps $(I^2, \partial I^2) \to (K,k_0)$, equipped with the compact-open topology. Also, $\langle X,\Omega^2 K\rangle$ is the set of all basepoint-preserving homotopy classes of maps $X \to \Omega^2 K$, where the basepoint of $\Omega^2 K$ is the constant map at $k_0$.
For two maps $f,g\colon(I^2, \partial I^2) \to (K,k_0)$, we define $f+g\colon(I^2, \partial I^2) \to (K,k_0)$ by letting $(f+g)(s_1,s_2)=f(2s_1,s_2)$ for $s_1 \leq 1/2$ and letting $(f+g)(s_1,s_2)=f(2s_1-1,s_2)$ for $s_1 \geq 1/2$. From the argument for showing $\pi_2(Y)$ is abelian for all spaces $Y$, we know that $f+g$ and $g+f$ are homotopic rel $\partial I^2$.
Then for two basepoint-preserving maps $\alpha,\beta\colon X \to \Omega^2 K$, we define their sum $\alpha+\beta\colon X \to \Omega ^2 K$ by letting $(\alpha+\beta)(x)=\alpha(x)+\beta(x)$ for all $x \in X$. Then we define $[\alpha]+[\beta]=[\alpha+\beta]$ in $\langle X,\Omega ^2 K \rangle$, and it is easily checked that this is well-defined. Also, using a similar argument to the argument of showing $\pi_n$ is a group, I have checked that $\langle X,\Omega^2 K \rangle$ becomes a group under $+$. It now remains to show that $\langle X,\Omega^2 K\rangle$ is abelian. I think I should use the argument that $\pi_2$ is abelian, but I got stuck. How do I have to proceed?
Thanks in advance.
This is one instance where it's more natural to think about things at the $H$-space level and then derive the corresponding statements at the group level by taking $\pi_0$. In particular the commutativity of $\langle X, \Omega^n K \rangle$ for $n\geq 2$ ultimately comes from the fact that we're mapping into a space that has a homotopy-abelian operation.
(For convenience I'll say an "$H$-group" is an $H$-space that is homotopy-associative and has homotopy-inverses. By $Map(X, Y)$ I mean the space of continuous functions with the compact-open topology, and $Map_\bullet(X, Y)$ is the subspace of basepoint reserving maps. All spaces and homotopies are assumed to be pointed, and $H$-spaces are canonically pointed by their homotopy-unit. I will abuse notation slightly and call $X$ a pointed $H$-space/group if it is an $H$-space/group such that $\mu_X(e_X,e_X) = e_X$ and such that all the relevant homotopies can be chosen to be basepoint-preserving.)
If you're unfamiliar with $H$-spaces you should prove for yourself the following lemmas:
As a corollary of Lemmas 1 and 3 we have that $\pi_n(X)$ is a group for all $n\geq 1$ and abelian for $n\geq 2$, using the fact that $\pi_n(X) =\pi_0(\Omega^n X)$. You should be able to prove the result you need now using these Lemmas, and the fact that $\langle X, \Omega^n K \rangle = \pi_0(Map_\bullet(X, \Omega^n K))$.
Edit: I realized that the condition I previously had on $Y$ for Lemma $2$ wasn't strong enough for the induced $H$-blah structure on $Map(X, Y)$ to restrict to $Map_\bullet(X, Y)$, I needed to use what I called "pointed $H$-blahs" but this notion may already have a different name in the literature. It seems that if $Y$ is a well-pointed space then these notions are equivalent but it's maybe not totally easy to show.