a functor is something that atkes objkects to objects, takes maps between pairs of objects to similar maps, takes identities to identities, and takes compositions to compositions. hence it also takes inverses to inverses.
i.e. if ∏ is a functor from spaces to groups such as the fundamental group, and if f:X-->Y is a homeomorphism, that means there is a map g:Y-->X such that fg = idY and gf = idX are the identities on Y and X respectively.
Hence, since ∏ is a functor from top spaces to groups, then ∏(f) and ∏(g) are homomorphisms from ∏(f):∏(X)-->∏(Y), and ∏(g):∏(Y)-->∏(X), such that
∏(f)o∏(g) = ∏(fog) = ∏(idY) = id(∏(Y)), and similarly the other way.
Hence ∏(f) and ∏(g) are inverse homomorphisms of the groups ∏(Y) AND ∏(X), so those groups are isomorphic.
Now the fundamental group is a functor, so itab tkes homeomorphisms to isomorphisms of groups. But also the fundamental group is by tis very definition constant on homotopy classes of maps, hence also takes homotopy equivalences to isomorphisms.
so all this is ":trivial" from the category theoretic point of view. i.e., learn to think in terms of maps, not just objects, and these questions will become automatic to you.