The answer to both is no: A map between two Eilenberg-Mac Lane spaces of different degrees has to induce 0 on homotopy (since both space have only one homotopy group each, and they are in different degrees), but there are many nontrivial maps between them (they form the ring of cohomology operations). For a counterexample to the second statement, just take two different-dimensional spheres and a nontrivial map between them, like the Hopf map $S^3 \to S^2$.
When you restrict to finite CW-complexes in the homotopy setting, the question becomes much more subtle and the answer is actually not known, even stably; it is one of the classical big open conjectures of algebraic topology, called the generating hypothesis.
The relationship between $Hom(H^*(Y),H^*(X))$ and $[X,Y]$ is very well studied; in general the latter is the target of a spectral sequence called the (unstable) Adams spectral sequence whose $E^2$-term consists of $Ext^*(H^*(Y),H^*(X))$, the derived functors of $Hom$, in the category of unstable algebras over the Steenrod algebra. If you want to learn this, I recommend starting with the stable setting, which is significantly easier. Then an answer to your question for what spaces $f^*=0$ implies $f\sim *$ could be: when $H^*(X)$ is injective as an unstable algebra, or when $H^*(Y)$ is projective. This doesn't happen very often, but it does happen, for example, when $X$ is the classifying space of a $p$-group and $Y$ is $p$-complete -- you'll get into Lannes' $T$-functor theory.