Suppose we have a (continuous) map $p:E\rightarrow X$. Assume that $p$ has the right lifting property with respect to any relative $CW$-complex $i:A\rightarrow B$. I want to show that $p$ is a Serre fibration and a weak equivalence.
The first part, to prove that $p$ is a Serre fibration is easy since $I^n\rightarrow I^{n+1}$ is a relative $CW$-complex. But how to prove that $p$ is a weak equivalence. We have to show that the induced map $p_*$ is a isomorphism of homotopy groups for each $n\in\mathbb{N}$ and each base point $e_0\in E$.
Can one use CW-approximation, Whitehead Theorem of a result which is related to this facts?
Thanks.
The inclusions $S^n \to D^{n+1}$ and $* \to S^n$ are relative CW-complexes, so any diagram like one of the following two has a homotopy lift: $$\require{AMScd} \begin{CD} S^n @>>> E @. * @>>> E \\ @VVV @VVV @VVV @VVV \\ D^{n+1} @>>> B @. S^n @>>> B \end{CD}$$ By taking $n=0$ it's easy to see that this $p$ is a bijection on $\pi_0$ (basically use the same technique as below, I just don't want to write down base points). WLOG we can thus assume that $E$ and $B$ are path connected. Now the morphism $p_* : \pi_n E \to \pi_n B$ is:
injective: if $\alpha \in \pi_n E$ is such that $p_* \alpha = 0$, let $f : S^n \to B$ be a representative. $p_* \alpha = 0$ means that $p \circ f$ is nullhomotopic, or equivalently factors through $D^{n+1}$ (up to homotopy). But by the lifting property of the first diagram, this implies that $f$ factors through $D^{n+1}$ though up to homotopy, so $\alpha = 0$.
surjective: let $\alpha \in \pi_n B$ be represented by $f : S^n \to B$. Then by the lifting property of the second diagram, $f$ has a homotopy lift $g : S^n \to E$ such that $p \circ g \simeq f$. Then $p_* [g] = \alpha$.
Therefore $p$ is a isomorphism on all homotopy groups, so it's a weak equivalence. For the record, such a map $p$ is called an acyclic Serre fibration.