I made the following claim over at the Secret Blogging Seminar, and now I'm not sure it's true:

Let f: X --> Y and g: X --> Y be two maps betwen finite CW complexes. If f and g induce the same map on pi_k, for all k, then f and g are homotopic.

Was I telling the truth?

EDIT: Since I didn't say anything about basepoints, I probably should have said that f and g induce the same map

[S^k, X] --> [S^k, Y].

This will also deal better with the situation where X and Y are disconnected. I'd be interested in knowing a result like this either with pointed maps or nonpointed maps. (Although, of course, if you work with pointed maps you have to take X and Y connected, because [S^k, _] can't see anything beyond the number of components in that case.)

-

This is not true. Consider, for example, a degree 1 map from a torus S^1 \times S^1 to S^2 (concretely, realize the torus as a square with identifications, and then collapse the boundary of the square to a point). This map is trivial on all homotopy groups (since for any n>0, \pi_n is 0 for either the domain or the codomain), but it is not homotopically trivial because it is nonzero on H_2.

If you want to demand that the spaces be simply connected, you can get a counterexample by considering cohomology operations: the cup square, for example, gives a map from K(Z,n) to K(Z,2n) which is nontrivial, but for the same reason as the previous example it must be 0 on homotopy groups. This example is not finite-dimensional, but it's probably possible to find one that is--I just don't know how because I don't know how to show a map is trivial on homotopy groups if the spaces have infinitely many nontrivial homotopy groups whose values are unknown, which is the case for most finite-dimensional examples.

-
Thank you very much! –  David Speyer Oct 26 '09 at 20:53
A further example from Allen Hatcher: The same thing works for the quotient map S^n x S^n ---> S^{2n} collapsing S^n v S^n to a point. This map is trivial on homotopy groups since \pi_i(S^n x S^n) = \pi_i(S^n) x \pi_i(S^n), so the inclusion of S^n v S^n into S^n x S^n is surjective on \pi_i. –  Eric Wofsey Oct 27 '09 at 17:53

Another interesting counterexample is given by so-called "phantom maps", which induce the zero map on all homotopy groups but are not nullhomotopic. Given an infinite CW-complex X which is a union ∪Xn of finite subcomplexes, Milnor described homotopy classes of maps out to Y where the phantom maps are given by a "lim1"-term.

For example, I believe that using this Brayton Gray used this to construct a map from CPinfinity to S3 that is nullhomotopic on CPn for all n.

-
It is worth pointing out that phantom maps are not uncommon. Indeed, in a compactly generated triangulated category an object which is not the target of any non-zero phantom map is pure-injective and the isomorphism classes of indecomposable pure-injective objects form a set. –  Greg Stevenson Oct 27 '09 at 2:20

For finite spectra, your question is precisely Freyd's generating hypothesis, which is open.

-