### $G = SU(2)$ ###
Now let's consider the $SU(2)$ gauge theory. Recall that if $U\in G$, $U = a +i\vec{b}\cdot \vec{\sigma}$, $a^2+|b|^2=1$. Therefore, topologically $SU(2)$ is $S^3$. From over previous discussion, $g:S^3\rightarrow SU(2)$ becomes $g:S^3\rightarrow S^3$. The homotopy group of such mapping is called $\Pi_3(S^3)$ (the $3$ in the subscript of $\pi$ means mapping from a three-sphere), and it turns out that $\Pi_3(S^3) = Z$. It's very difficult to visualize a three-sphere, but we can get some intuition to why $\Pi_3(S^3) = Z$ by looking at $\Pi_1(S^1)$, the mapping from one-sphere to one-sphere. The following lists a few possible mappings, and they each have an integer associated with them which tells how many times the one-sphere is wrapped around the other, called the winding number. I won't do a rigorous proof but it is not hard to believe that mapping with different winding numbers cannot be continuously deformed to each other. Therefore the set of all possible winding numbers, Z, is the homotopy group of mapping one-sphere to one-sphere.
Back to the three-sphere case. We list here the standard mappings: $g^{(1)}(x) = (x_4+i\vec{x}\cdot\vec{\sigma})/r$ is the identity mapping, that takes the three-sphere and maps it exactly onto the same three-sphere. Mapping with higher winding number can be obtained by taking powers of $g^{(1)}$: $g^{(\nu)}(x) = [g^{(1)}(x)]^{\nu}$. It can be shown that every mapping $g$ is homotopic to $g^{(\nu)}(x)$, so the standard mappings are all the classes we have.
Moreover, the winding number can be expressed as the conserved charge of the Chern-Simon's current. The current is $$K_{\mu} = \epsilon_{\mu\nu\alpha\beta}\left(A^a_{\mu}F^a_{\alpha\beta}-\frac{g}{3}f^{abc}A^a_{\nu}A^b_{\alpha}A^c_{\beta}\right),$$
and the winding number is given by
$$n = \frac{g^2}{32\pi^2}\int K^0 d^3x.$$
This can also be rewritten as the integral over all spacetime
$$n = \frac{g^2}{32\pi^2}\int d^4 x G_{\mu\nu}^a \widetilde{G} _{\mu\nu}^a$$
because of $G_{\mu\nu}^a \widetilde{G} _{\mu\nu}^a = \partial_{\mu}K^{\mu}$. The key point from these formula is that the winding number can be expressed as an integral over a local density. We will use this fact later on.