Proof (homotopy equivalence descends on path components)

If $f: X\to Y$ has a homotopy inverse $g: Y\to X$, then $π_0(g) \circ π_0(f)$${}={}$$π_0(g\circ f)$${}={}$$π_0(\id_X)$${}={}$$\id_{π_0(X)}$. Similarly $π_0(f)\circ π_0(g) = \id_{π_0(Y)}$. Thus $π_0(g) = π_0(f)\inv$.