Let X={a, b}, Y={d, e, f}, Z={g, h}.
f:a→d,b→e .
g:d→g,e→h,f→h .
Then g (f (x)): a → g, b→h, is injective. F single, g not only.