Does there exist a compression function (from four 32-bit words to one 32-bit word) that always detects any modification of a single word?
I may be missing some subtlety intended by the problem-setter, but the simple answer that satisfies the stated conditions, or damn near, is to just xor the words:

$$F = w_1 \oplus w_2 \oplus w_3 \oplus w_4$$

If we model any change to $w_i$ as xoring with a nonzero error term $e_i$, since xor is linear in $GF(2^n)$ 

$$F' = (w_1\oplus e_1)\oplus (w_2\oplus e_2)\oplus (w_3\oplus e_3)\oplus (w_4\oplus e_4)
\\
= F \oplus (e_1\oplus e_2\oplus e_3\oplus e_4)$$

If only one of $e_i$ is nonzero, the net error is nonzero. If more than one of $e_i$ is nonzero, independently at random, the probability that the net error is zero is almost $2^{-32}$ -- excluding zero from some of the choices throws it off slightly, but I don't remember enough probability to compute exactly how.