I was wondering if the following general problem has a standard solution.
Let $X, Y, Z$ be CW-complexes and $f: X \to Y, g: X \to Z$ be continuous functions. Is there a criterion to say when it does exist $h: Y \to Z$ such that $hf \simeq g$? (homotopy equivalence)
I am motivated by the following trivial observation: if $\text{hofib}f \simeq *$, then $f$ is a weak homotopy equivalence and then by Whitehead $f$ is an homotopy equivalence, so it exists $h': Y \to X$ such that $h'f \simeq \text{id}_X$. Then $gh'f \simeq g$. So if $\text{hofib}f \simeq *$ then $h = gh'$ solves the problem.
Obviously requiring $\text{hofib}f \simeq *$ is too strong and also it does not involve the map $g$.
Does it exist a kind of "generalized homotopy fiber" $\text{hofib}(f, g)$ such that if $\text{hofib}(f, g) \simeq *$ then the general problem is solvable? (even if $\text{hofib} f \not\simeq *$ clearly)