I proved the following two elementary but useful theorems:
Theorem For every funcoids $latex f$, $latex g$:
- If $latex \mathrm{im}\, f \supseteq \mathrm{im}\, g$ then $latex \mathrm{im}\, (g\circ f) = \mathrm{im}\, g$.
- If $latex \mathrm{im}\, f \subseteq \mathrm{im}\, g$ then $latex \mathrm{dom}\, (g\circ f) = \mathrm{dom}\, g$.
Theorem For every reloids $latex f$, $latex g$:
- If $latex \mathrm{im}\, f \supseteq \mathrm{im}\, g$ then $latex \mathrm{im}\, (g\circ f) = \mathrm{im}\, g$.
- If $latex \mathrm{im}\, f \subseteq \mathrm{im}\, g$ then $latex \mathrm{dom}\, (g\circ f) = \mathrm{dom}\, g$.
See this Web page and especially this online article.