Characteristic Classes
Idea. Cohomology classes attached to a bundle that measure its global twist. Equal bundles ⇒ equal classes; nonzero classes ⇒ nontrivial bundle (no global trivialization, no global gauge).
Chern–Weil construction (the miracle). Take a connection, form invariant polynomials in its curvature, e.g. $\mathrm{tr}(F^k)$. These are closed forms whose de Rham Cohomology classes are independent of the chosen connection — pure topology computed from geometry. Curvature is local and connection-dependent; its invariant integrals are global and rigid.
The one that matters here — first Chern class ($U(1)$-bundles): $$c_1 = \left[\frac{iF}{2\pi}\right] \in H^2(M; \mathbb{Z}), \qquad \text{over } S^2: \; c_1[S^2] = \frac{i}{2\pi}\int_{S^2} F \in \mathbb{Z}.$$ Classifies $U(1)$-bundles over $S^2$ completely: $c_1 = 0$ trivial, $c_1 = 1$ Hopf Fibration, $c_1 = n$ charge-$n$ Dirac Monopole sector. Integrality of $c_1$ = quantization of magnetic charge.
The zoo (for orientation). Chern classes $c_k$ (complex bundles), Stiefel–Whitney $w_k$ (real; $w_1(\text{Möbius}) \neq 0$), Pontryagin (real, 4k); second Chern number = instanton number in Yang-Mills Theory.
Related: Curvature 2-Form · de Rham Cohomology · Dirac Monopole · Hopf Fibration · Module 11 - Topology - Monopoles and Chern Classes
Sources: Nakahara Ch. 11; Sternberg touches Weil homomorphism in Ch. VII (edition-dependent).