On the solution of the functional equation $f\circ g(z)=F(z)$