By definition,$f$ and $g$ are bijective functions because they are one-to-one and onto.
$f^{-1}: \{a, b, c\} \rightarrow \{1, 2, 3\}$ is defined as $f^{-1}(a)=1, f^{-1}(b)=2, f^{-1}(c)=3$.
$g^{-1}: \{\text{apple, ball, cat}\} \rightarrow \{a, b, c\}$ is defined as $g^{-1}(\text{apple})=a, g^{-1}(\text{ball})=b, g^{-1}(\text{cat})=c$.
Since $f^{-1} \circ f = I_{\{1, 2, 3\}}$ and $f \circ f^{-1} = I_{\{a, b, c\}}$,$f$ is invertible.
Since $g^{-1} \circ g = I_{\{a, b, c\}}$ and $g \circ g^{-1} = I_{\{\text{apple, ball, cat}\}}$,$g$ is invertible.
$g \circ f: \{1, 2, 3\} \rightarrow \{\text{apple, ball, cat}\}$ is defined as $(g \circ f)(1)=\text{apple}, (g \circ f)(2)=\text{ball}, (g \circ f)(3)=\text{cat}$.
$(g \circ f)^{-1}: \{\text{apple, ball, cat}\} \rightarrow \{1, 2, 3\}$ is defined as $(g \circ f)^{-1}(\text{apple})=1, (g \circ f)^{-1}(\text{ball})=2, (g \circ f)^{-1}(\text{cat})=3$.
Now,$(f^{-1} \circ g^{-1})(\text{apple}) = f^{-1}(g^{-1}(\text{apple})) = f^{-1}(a) = 1 = (g \circ f)^{-1}(\text{apple})$.
$(f^{-1} \circ g^{-1})(\text{ball}) = f^{-1}(g^{-1}(\text{ball})) = f^{-1}(b) = 2 = (g \circ f)^{-1}(\text{ball})$.
$(f^{-1} \circ g^{-1})(\text{cat}) = f^{-1}(g^{-1}(\text{cat})) = f^{-1}(c) = 3 = (g \circ f)^{-1}(\text{cat})$.
Thus,$(g \circ f)^{-1} = f^{-1} \circ g^{-1}$.