# Given two functions f and g, what is the inverse of g @ f ?

Dec 18, 2017

Assuming $f$ and $g$ are both invertible, you can say that ${\left(g \circ f\right)}^{- 1} = {f}^{- 1} \circ {g}^{- 1}$. This is sometimes called the "socks-shoes property".

#### Explanation:

This can be verified using the associative property for function composition:

$\left(g \circ f\right) \circ \left({f}^{- 1} \circ {g}^{- 1}\right) = g \circ \left(f \circ {f}^{- 1}\right) \circ {g}^{- 1}$

$= g \circ i d \circ {g}^{- 1} = g \circ {g}^{- 1} = i d$,

where $i d$ represents the "identity function" $i d \left(x\right) = x$ for all $x$.

The property is called the "socks-shoes property" because if $f$ represents "putting your socks on" and $g$ represents "putting your shoes on", then $g \circ f$ represents "putting your socks and shoes on" and ${\left(g \circ f\right)}^{- 1}$ represents "taking your socks and shoes off". The fact that ${\left(g \circ f\right)}^{- 1} = {f}^{- 1} \circ {g}^{- 1}$ means that, to do this, you must "take your shoes off" (apply ${g}^{- 1}$) before you "take your socks off" (apply ${f}^{- 1}$).

A similar type of thing happens with matrix multiplication, or indeed, in any group $G$. Given a group $G$ and $a , b \setminus \in G$, ${\left(a b\right)}^{- 1} = {b}^{- 1} {a}^{- 1}$.