Image of a map on cohomology rings

No. Consider the Hopf map $\eta:S^3\to S^2$. If there were such a space $Z$, it would have $\widetilde H^*(Z)=0$, so at the very least $Z$ would be stably trivial, forcing $\eta$ to be stably trivial; but it’s not.


One special case of your set up is when $Y=X$ and $f^*$ is idempotent: $f^* \circ f^* = f^*$. In this case, let $Z$ be the mapping telescope of $X \xrightarrow{f} X \xrightarrow{f} X \rightarrow \dots$. This comes with a canonical map $r: X \rightarrow Z$ such that $r^*$ is monic with image equal to the image of $f^*$, and in many cases, one can show that there exists $i: Z \rightarrow X$ such that $r^* \circ i^* = f^*$.

(We are basically looking to lift an idempotent in homology to an idempotent in homotopy. One sufficient condition for $i$ to exist is that $X$ be a $p$--complete CW complex of finite type: see the short paper Atomic spaces and spectra I wrote with J.F. Adams back in the late 1980's.)