TITLE: Whitehead for maps
QUESTION [21 upvotes]: I made the following claim over at the Secret Blogging Seminar, and now I'm not sure it's true:
Let $f: X \to Y$ and $g: X \to Y$ be two maps between 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] \to [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.)

REPLY [6 votes]: Another class of examples comes from group cohomology: if $G$ is any group with interesting higher cohomology $H^n(G, A), n \ge 2$ then there are non-nullhomotopic maps $BG \to B^n A$ for some $n \ge 2$. But the source and target don't have nonzero homotopy groups in any shared degree so any such map induces the zero map on homotopy groups. If these cohomology groups all vanished then, among other things, groups would have no nontrivial central extensions and so all finite $p$-groups would be elementary abelian! 
(Edit: admittedly, the above examples don't usually involve finite complexes. But with the right $G$ we can take $BG$ to be an aspherical manifold and then we can truncate $B^n A$.) 
This is the precise analog, in topology, of the fact in homological algebra that in most interesting abelian categories $\text{Ext}^i$ can be nontrivial for $i \ge 1$, which reflects the existence of maps in derived categories between two objects which don't have nonzero homology groups in any shared degree. 
Group cohomology turns out to be a pretty good model for the more general question: 

What is a complete set of obstructions for a map $f : X \to Y$ (let's say pointed, between pointed CW complexes) to be nullhomotopic? 

There is an obstruction theory coming from trying to lift $f$ up through the stages of the Whitehead tower
$$\dots \to Y_2 \to Y_1 \to Y_0 \cong Y$$
of $Y$. Here $Y_k$ is the $(k-1)$-connected cover of $Y$, obtained from $Y$ by killing $\pi_1, \pi_2, \dots \pi_{k-1}$ (so the index tells you the lowest degree in which it can have a nontrivial homotopy group). In particular $Y_1$ is the connected component of the basepoint and $Y_2$ is the universal cover. 
At each stage, suppose we've lifted $f$ to a map $f_n : X \to Y_n$. Now, $Y_n$ has lowest homotopy group $\pi_n(Y_n) \cong \pi_n(Y)$, and hence there is a natural map
$$k_n : Y_n \to B^n \pi_n(Y)$$
inducing an isomorphism on $\pi_n$. The pullback of this map along $f_n$ gives a cohomology class 
$$k_n \in H^n(X, \pi_n(Y))$$
which I'll also call $k_n$, and $f_n$ lifts to a map $f_{n+1} : X \to Y_{n+1}$ iff this cohomology class vanishes. (In general, $k_n$ is only well-defined once we've chosen a lift $f_n$.) The punchline now is that $f$ is nullhomotopic iff all lifts $f_n$ exist iff all classes $k_n$ vanish. If $X$ has finite cohomological dimension then this is in principle only finitely many conditions to check. 
Example. Let $Y = BO$ be the classifying space of stable real vector bundles, let $X$ be a smooth manifold, and let $f : X \to BO$ be the classifying map of the stable tangent bundle. Then $f$ is nullhomotopic iff $X$ is stably parallelizable. The characteristic classes $k_n$ are Bott periodic. Here are the first few:
$k_1$ is the first Stiefel-Whitney class $w_1$. It vanishes iff $f$ lifts to a map $f_2 : X \to BSO$ iff $X$ is orientable. Here $BSO$ is $Y_2$.
$k_2$ is the second Stiefel-Whitney class $w_2$. It vanishes iff $f_2$ lifts to a map $f_3 : X \to BSpin$ iff $X$ has a spin structure. Here $BSpin$ is $Y_3 \cong Y_4$.
$k_3$ automatically vanishes. $k_4$ is the first fractional Pontryagin class $\frac{p_1}{2}$. It vanishes iff $f_3$ lifts to a map $f_5 : X \to BString$ iff $X$ has a string structure. Here $BString$ is $Y_5 \cong Y_6 \cong Y_7$.

REPLY [5 votes]: A simple example with finite complexes would be the collapse map $q:X\times Y\to X \wedge Y$.  Since the inclusion $X \vee Y \hookrightarrow X\times Y$ is surjective on $\pi_*$,
$q_* = 0$.  But $q$ is generally nonzero on homology; for example if $X = S^n$, $Y=S^m$, 
then $q_*$ is an isomorphism on $H_{n+m}$.