Difference between represented and singular cohomology? Ordinary cohomology on CW complexes is determined by the coefficients.  There are (more than) two nice ways to define cohomology for non-CW-complexes:  either by singular cohomology or 
by defining $\widetilde H^n(X;G) = [X, K(G,n)]$.  Are there standard/easy examples where these
two theories differ?
One idea that comes to mind is the paper by Milnor and Barratt (about Anomolous Singular
Homology) which says that the  $n$-dimensional Hawaiian earring $H^n$ has nontrivial singular
homology in arbitrarily high dimensions.  But I don't see an easy way to compute
$[H^n, K(G, m)]$.
 A: Here are two examples similar to Ben's answer, followed by an example with a path-connected space.
Let $[X,Y]$ denote the naive pointed homotopy classes of pointed maps. We're comparing the (say, unreduced) singular cohomology functor $H^n(X;G)$ to the naively represented functor $[X_+, K(G,n)]$. As Chris pointed out, singular cohomology is representable in the derived sense, i.e., agrees with its value on a CW approximation of $X$.
Example 1. Let $T \subset \mathbb{R}^2$ be the topologist's sine curve
$$T = \{ (x, \sin \frac{1}{x}) \mid x \in (0,1] \} \cup \{(0,0)\}.$$
Its zeroth singular cohomology is the finite product
$$H^0(T;\mathbb{Z}) = \mathrm{Hom}_{\mathbb{Z}}(H_0(T;\mathbb{Z}), \mathbb{Z}) = \mathrm{Set}(\pi_0(T),\mathbb{Z}) = \mathbb{Z} \times \mathbb{Z}.$$
Its zeroth naive cohomology is
$$[T_+, K(\mathbb{Z},0)] = \mathrm{Set}(\ast,\mathbb{Z}) = \mathbb{Z}.$$
A CW approximation $S^0 \stackrel{\sim}{\to} T$ induces on zeroth naive cohomology the diagonal inclusion $\mathbb{Z} \hookrightarrow \mathbb{Z} \times \mathbb{Z}$.
Example 2. Let $X \subset \mathbb{R}$ be
$$X = \{ \frac{1}{n} \mid n \in \mathbb{N} \} \cup \{0\}.$$
Let me name the points $x_n = \frac{1}{n}$ and $x_{\infty} = 0$ for convenience. The zeroth singular cohomology is the countable product
$$H^0(X;\mathbb{Z}) = \mathrm{Set}(\pi_0(X),\mathbb{Z}) = \prod_{n \in \mathbb{N} \cup \{\infty\}} \mathbb{Z}.$$
The zeroth naive cohomology is the subgroup
$$[X_+, K(\mathbb{Z},0)] = \{ (a_n) \in \prod_{n \in \mathbb{N} \cup \{\infty\}} \mathbb{Z} \mid (a_n) \text{ is eventually constant}\},$$
which happens to be a free abelian group on countably many generators. A CW approximation from the discrete space $\coprod_{x \in X} \{x\} = \mathbb{N} \cup \{\infty\} \stackrel{\sim}{\to} X$ induces on zeroth naive cohomology the inclusion of said subgroup.
Example 3. Let $E = \bigcup_{n \in \mathbb{N}} C_n$ be the Hawaiian earring, where $C_n \subset \mathbb{R}^2$ denotes the circle of radius $\frac{1}{n}$ centered at $(\frac{1}{n},0)$. There is a surjective map $H_1(E; \mathbb{Z}) \twoheadrightarrow \prod_{n \in \mathbb{N}} \mathbb{Z}$; see for instance Hatcher Example 1.25 or [1]. Dualization into $\mathbb{Q}$ yields an injective map
$$\mathrm{Hom}_{\mathbb{Z}}(\prod_{i \in \mathbb{N}} \mathbb{Z}, \mathbb{Q}) \hookrightarrow \mathrm{Hom}_{\mathbb{Z}}(H_1(E; \mathbb{Z}), \mathbb{Q}) = H^1(E; \mathbb{Q}),$$
which shows that the first singular cohomology $H^1(E; \mathbb{Q})$ has uncountable dimension as a vector space over $\mathbb{Q}$. Indeed, the vector space
$$\mathrm{Hom}_{\mathbb{Z}}(\prod_{i \in \mathbb{N}} \mathbb{Z}, \mathbb{Q}) = \mathrm{Hom}_{\mathbb{Q}}(\mathbb{Q} \otimes_{\mathbb{Z}} (\prod_{i \in \mathbb{N}} \mathbb{Z}), \mathbb{Q})$$ has uncountable dimension since $\mathbb{Q} \otimes_{\mathbb{Z}} (\prod_{i \in \mathbb{N}} \mathbb{Z})$ does.
Now denote $W_n = \bigcup_{i=1}^n C_i \cong \bigvee_{i=1}^n S^1$ and consider the retraction $E \to W_n$ that collapses all the circles $C_i$ with $i>n$ to the basepoint. Take a CW complex $K(\mathbb{Q},1)$. Any (pointed) map $E \to K(\mathbb{Q},1)$ is (pointed) homotopic to a map which factors as $E \to W_n \to K(\mathbb{Q},1)$ for $n$ large enough. This shows that the map
$$\bigoplus_{i \in \mathbb{N}} \mathbb{Q} = \operatorname{colim}_n [W_n, K(\mathbb{Q},1)] \twoheadrightarrow [E,K(\mathbb{Q},1)]$$
is surjective, and thus the naive cohomology group $[E,K(\mathbb{Q},1)]$ is countable. In particular, a CW approximation $E' \stackrel{\sim}{\to} E$ induces a non-surjective map on naive cohomology $[E,K(\mathbb{Q},1)] \to H^1(E;\mathbb{Q})$.
Edit. For the record, I previously thought that a similar argument would work with integral cohomology $H^1(E;\mathbb{Z})$, but I had forgotten Specker's theorem $\mathrm{Hom}_{\mathbb{Z}}(\prod_{i \in \mathbb{N}} \mathbb{Z}, \mathbb{Z}) \cong \bigoplus_{i \in \mathbb{N}} \mathbb{Z}$.
In fact, it turns out that said cohomology group is $H^1(E;\mathbb{Z}) \cong \bigoplus_{i \in \mathbb{N}} \mathbb{Z}$, as explained here.
[1] Katsuya Eda and Kazuhiro Kawamura, MR 1772189 The singular homology of the Hawaiian earring, J. London Math. Soc. (2) 62 (2000), no. 1, 305--310.
A: This is a good question because it really hits on a subtle issue. It turns out that Johannes and Ben are both correct and incorrect at the same time unless we settle some very subtle issues. Let me explain.
There are really two things at issue here. The first is what is meant by the notation [X,Y] when X is not a CW-complex. Is it homotopy classes of maps? Or is it weak homotopy classes of maps? The other thing at issue is what is meant by a cohomology theory? Is it a functor which sends just homotopy equivalences to isomorphisms? or is it also required to send weak homotopy equivalences to isomorphisms?
These decisions determine who is right or wrong. Let X be the cantor set as in Ben's answer. As Ben rightfully points out the homotopy class of maps from X into the discrete space $\mathbb{Z}$ must factor through a finite quotient, while the singular cohomology is much larger. So Ben is interpreting [X, Y] to mean homotopy classes of maps. Weak homotopy classes of maps are more subtle. They are the morphisms in the derived category of spaces and are defined by taking equivalence classes of spans: 
$$ X \stackrel{\sim}{\leftarrow} X' \rightarrow Y $$
where $X'$ ranges over spaces weakly homotopy equivalent to X. Equivalently you can replace X with any cofibrant replacement, like a CW-approximation. In the case of X= the Cantor set, the CW-replacement is a disjoint union of uncountably many points, and so the weak homotopy equivalence classes of maps does in fact agree with singular cohomology. 
More generally if [X,Y] denotes weak homotopy classes of maps, then Johannes' statement is correct. The functor $[-, K(\mathbb{Z}, n)]$ always agrees with singular cohomology. 
This brings us to the issue of what exactly a cohomology theory is supposed to be? If you ask an algebraic topologist they will usually tell you that a cohomology theory is defined so that it sends weak equivalences to isomorphisms (The Axiom of Weak Equivalence). If this is our definition, and [X,Y] denotes homotopy classes of maps and not weak homotopy classes of maps, then $[-, K(\mathbb{Z}, n)]$ fails to be a cohomology theory. But it is in good company Cech cohomology and sheaf cohomology also fail this litmus test, so many people outside of algebraic topology feel uncomfortable with this axiom. 
However it is necessary for the uniqueness result of the Eilenberg-Steenrod axioms. The Axiom of Weak Equivalence implies that the cohomology theory is determined by its value on CW-complexes, and the rest of the axioms lock this down. Without the Axiom of Weak Equivalence there is very little control on what the theory assigns to spaces which do not have the homotopy type of CW-complexes. 
A: The Cantor set has exotic zeroth cohomology. Its singular cohomology is the linear dual of its zeroth singular homology, which is the free abelian group on its set of points. Thus its singular cohomology is an uncountable infinite product of $\mathbb Z$. Its represented cohomology is the set of continuous maps to the discrete space $\mathbb Z$, which must factor through a finite quotient. It is a free abelian group on countably many generators.
A: Probably what David has in mind is the old (1961) result of Huber
that if X is a paracompact Hausdorff space, then the $n$th Cech cohomology 
group of X with coefficients in $\pi$ is isomorphic to the actual set of 
homotopy classes of maps $X\longrightarrow K(\pi,n).$  So Jeff is
perhaps expressing a preference for Cech over singular cohomology. As
Chris says, current practice in algebraic topology is to accept the 
weak equivalence axiom.  Model theoretically, that expresses a 
preference for the Quillen (or the mixed) model structure over the
Strom model structure on spaces.
