Representations of \pi_1, G-bundles, Classifying Spaces This question is inspired by a statement of Atiyah's in "Geometry and Physics of Knots" on page 24 (chapter 3 - Non-abelian moduli spaces). 
Here he says that for a Riemann surface $\Sigma$ the first cohomology $H^1(\Sigma,U(1))$, where $U(1)$ is just complex numbers of norm 1, parametrizes homomorphisms $$\pi_{1}(\Sigma)\to U(1).$$ 
This is fine by me, after all by Brown Representability we know $$H^1(\Sigma,G)\cong [\Sigma,BG]=[B\pi_{1}\Sigma,BG]$$ since we know that Riemann surfaces are $K(\pi_{1},1)$s. We then use the handy fact from Hatcher Prop. 1B.9 (pg 90) that shows that... 

For $X$ a connected CW complex and $Y$ a $K(G,1)$ every homomorphism $\pi_1(X,x_0)\to\pi_1(Y,y_0)$ is induced by a map $(X,x_0)\to(Y,y_0)$ that is unique up to homotopy fixing $x_0$.

So group homomorphisms $\pi_{1}(\Sigma)\to U(1)$ correspond on the nose with first cohomology of the $\Sigma$ with coefficients in $U(1)$.
EDIT: To be accurate the Hatcher result shows we have an injection of group homomorphisms into homotopy classes of maps. Does anyone know if every homotopy class of maps is realized by a group homomorphism?
What bothers me is what comes next. Now replace $U(1)$ with $G$ - any compact simply connected Lie group, take $G=SU(n)$ for example. Now Atiyah claims that $H^1(\Sigma,G)$ parametrizes conjugacy classes of homomorphisms $\pi_{1}(\Sigma)\to G$.
Now if the fundamental group or the Lie group were abelian this would be the same statement, but higher genus Riemann surfaces (genus greater than 1) have non-abelian fundamental groups and Atiyah is looking specifically at non-abelian $G$. Also, it seems that the statement of Brown Representability requires abelian coefficient groups, so I am stuck. 
Does anyone know a clean way of proving Atiyah's claim?
EDIT2: I renamed the question to draw in the "right" people. I think the answer has to do with the fact that principal G-bundles over a Riemann surface are determined by maps of $\pi_1(\Sigma)\to G$ (can someone explain why?). This is related to local systems and/or flat connections, which I don't understand well. Thanks!
 A: Since it is not always clear what $H^1(X;G)$ means for a non-abelian group, Atiyah might have meant this loosely, perhaps using Cech 1-cocycles to construct flat $G$ bundles, with homologous cycles giving isomorphic bundles. The moduli space of flat bundles is homeomorphic (and real analytically isomorphic) to the space of conjugacy classes of $G$ representations via the holonomy. I suspect this is what Ben is hinting at in his answer above.
But another  interpretation in terms of homotopy classes of maps to $BG$ is as follows. If you give $G$ the discrete topology, then $BG$ is a pointed space with a fixed choice of isomorphism $\pi_1(BG)\cong G$.  So
$Hom(\pi_1(X),G)$ is in bijective correspondence with the pointed homotopy classes of maps $[X,BG]_0$. The free homotopy classes $[X,BG]$ are then in bijective correspondence with the conjugacy classes $Hom(\pi_1(X),G)/conj$, since the action of $G=\pi_1(BG)$ on the pointed homotopy classes corresponds to conjugation, with quotient the free homotopy classes. So if you define $H^1(X;G)=[X,BG]$ (unbased), you get Atiyah's statement.  
In the case of Atiyah's book, though,  more important that the notation for the space of conjugacy classes of reps is the fact that at a representation $r:\pi_1(\Sigma)\to G$, the (usual, twisted by the adjoint rep) cohomology $H^1(\Sigma; g_r)$ ($g$ the lie algebra of $G$)is the Zariski tangent space to the variety of conjugacy classes of representations at $r$, i.e. to the moduli space of flat $G$ connections on $\Sigma$. The cup product
$H^1(\Sigma; g_r)\times H^1(\Sigma; g_r)\to R$ determines a symplectic form on this variety, and a holomorphic structure on $\Sigma$ induces a complex structure on this variety, which reflects itself in the Zariski tangent space as an almost complex structure $J:H^1(\Sigma; g_r)\to H^1(\Sigma; g_r)$ which coincides with the Hodge $*$ operator on harmonic forms.  
Incidentally, all principal $SU(2)$ bundles over a Riemann surface are topologically trivializable.
A: Atiyah's statement makes sense only if one gives $U(1)$ the discrete topology, otherwise it is just plain false (continuous $U(1)$-bundles are classified topologically by their first Chern class, which is an element of $\mathrm{H}^2(\Sigma, \mathbb{Z}) = \mathbb{Z}$). But then it has nothing to do with having a Riemann surface, it holds for any topological space  and any discrete abelian group of coefficients (at least if you use the right cohomology theory). Also, the other statement is just covering group theory, for any discrete group $G$ and any topological space $\Sigma$, if one interprets $\mathrm H^1(\Sigma,G)$ as parametrizing isomorphism classes of Galois $G$-covers on $\Sigma$.
By the way, it is not true that holomorphic bundles on Riemann surfaces always admit homolorphic connections; for example, the only holomorphic line bundles that do are the ones with trivial first Chern class.
A: $H^1(X,\mathcal G)$ where $X$ is any topological space, and $\mathcal G$ any sheaf of groups, classifies $\mathcal G$-torsors on $X$.  A $\mathcal G$-torsor is a sheaf of sets with a $\mathcal G$-action on $X$ which is isomorphic to the sheaf $\mathcal G$ on small enough open sets.
If $\mathcal G$ is the set of locally constant functions valued is a group $G$, then a $\mathcal G$-torsor is really just an $G$-local system (this is essentially by definition), so for any group this result holds.
EDIT: Paul's answer made me realize I hadn't proceeded to then point out that a local system is the same thing as a map $\pi_1(X)\to G$ up to conjugacy, by taking the monodromy along paths (which requires choosing base points, hence the conjugacy).  I wasn't trying to be mysterious; I just have this so ingrained in my head that I forgot it was worth mentioning.
You have to careful here, because when $G$ is a topological group, it's very tempting to think about the sheaf of continuous functions to $G$ on $X$; that's the sheaf of groups whose torsors are principal bundles. This will only agree with the above if $G$ is discrete (hence Angelo's answer).
