How to prove that $G$ is semidirect product?

If $$N\triangleleft G$$ and $$G / N$$ is a free group, I want to show that $$G$$ is a semi-direct product of $$N$$ by $$G / N$$, but I don't see how to prove it, I know if $$N$$ is normal to $$G$$, then $$G$$ is a semi-direct product of $$N$$ and $$G / N$$ if and only if there is a homomorphism $$s: G / N \to G$$ such that $$v\circ s: G/N \to G/N = id$$, where $$v: G\to G/N$$ is the natural projection. but I don't know where to put the hypothesis that $$G / N$$ is a free group.

If $$G/N$$ is a free group, say it is (isomorphic to) a free group on the set $$X$$. For each $$x\in X$$, let $$g_x\in G$$ be such that $$\pi(g_x)=x$$, where $$\pi\colon G\to G/N$$ is the canonical projection.. By the universal property of the free group, there exists a group homomorphism $$f\colon G/N\to G$$ such that $$f(x)=g_x$$ for each $$x\in X$$. Since $$\pi\circ f$$ is the identity on $$X$$, the universal property of the free group tells us that $$\pi\circ f=\mathrm{id}_{G/N}$$, and so it follows that $$f$$ is one-to-one. Therefore, $$G$$ contains a subgroup isomorphic to $$G/N$$.
Now verify that $$f(G/N)\cap N=\{e\}$$ and that $$G$$ is generated by $$N$$ and $$f(G/N)$$.