What are $f\circ\emptyset$ and $\emptyset\circ f$ if $\circ$ is function composition and $f$ is any function? My guess is that both are $\emptyset$ because if $g\circ f=\{(x,z)\mid \exists y\in \text{Im}f:(x,y)\in f\land (y,z)\in g\}$ then if $f$ or $g$ are the empty set then it doesn't exist any $y$ with such condition, so the set is empty. Am I right?
 A: Yes, you are right.
Under the convention that a function is a set $f$ of ordered pairs such that

if $(x,y)\in f$ and $(x,z)\in f$, then $y=z$

we can define function composition in the following way.

Let $f$ and $g$ be functions; then $g\circ f=\{(x,z):(x,y)\in f\text{ and }(y,z)\in g,\text{ for some }y\}$ is a function.

The empty set is obviously a function in the sense described above and, for every function $f$,
$$
\emptyset\circ f=\emptyset=f\circ\emptyset
$$
because $(a,b)\in\emptyset$ is false for every $a$ and $b$.
A: This is old, but I don't think I agree with the accepted answer.
In the usual interpretation of $g\circ f$, we assume that $\mathrm{cod}(f) = \mathrm{dom}(g)$, or at least $\mathrm{Im}(f) \subseteq \mathrm{dom}(g)$. Then $g\circ f:\mathrm{dom}(f)\to\mathrm{cod}(g)$. If we don't have $\mathrm{Im}(f) \subseteq \mathrm{dom}(g)$, then we must regard $g$ as a partial function to take the composition.
Since the empty function has domain $\emptyset$, I claim we have
$$
f\circ\emptyset = \emptyset,
$$
but
$$
\emptyset\circ f\ \textrm{is undefined (unless $f=\emptyset$)}.
$$
Taking instead the laxer definition of composition where we disregard domains and codomains, I of course agree with egreg, and the claim would be equivalent to
$$
\emptyset\circ_{\mathrm{lax}} f
:= \emptyset\circ \left(f\upharpoonright_{f^{-1}(\mathrm{dom}\ \emptyset)} \right)
= \emptyset\circ\emptyset
= \emptyset.
$$
