Difference between represented and singular cohomology?
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.
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.
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.