Structure of Proofs of Invertibility?

When trying to prove the invertibility of an objects (say, the composition of two functions), do we always structure the proofs by showing, not necessarily in this order, (1) that the inverse of the function composed with the function is equal to the identity, and (2) that the function composed with the inverse is equal to the identity? This would show that the function is equal to its inverse, which is our goal in the proof, right?

I ask because I'm trying to remember how to prove such theorems when asked on exams, so if they always follow this structure/format, then I'll always know how to proceed, regardless of the specifics of the theorem I'm being asked to prove.

The following is an example of one such proof that follows this structure.

Theorem: If $f: X \to Y$ and $g: Y \to Z$ are invertible, then $g \circ f: X \to Z$ is also invertible, with inverse $f^{-1} \circ g^{-1}$.

Proof: Suppose that $f: X \to Y$ and $g: Y \to Z$ are invertible.

We first show that the inverse of the function composed with the function is equal to the identity.

$(f^{-1} \circ g^{-1}) \circ (g \circ f) = f^{-1} \circ ( g^{-1} \circ g ) \circ f$ (By associativity of composition.)

$= f^{-1} \circ (i_Y) \circ f$ (Since the composition of a function with its inverse is equal to the identity on the domain of the function.)

$= f^{-1} \circ f$ (Since the identity on $Y$ just maps from $Y$ back to $Y$.)

$= i_X$ (Since $f^{-1} \circ f$ just maps from $X$ back to $X$.)

And we now prove that the function composed with the inverse is equal to the identity.

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

$= g \circ (i_Y) \circ g^{-1}$

$= g \circ g^{-1}$

$= i_Z$

Therefore, $(g \circ f)^{-1} = f^{-1} \circ g^{-1}$.

$Q.E.D.$

• There are different kinds of inverses : inverses in a group, inverses of a matrix , inverses of a map and so on. Not sure they can all be handled in the same way. – Peter Jul 29 '18 at 19:34
• @Peter Oh, ok. But what I wrote would be true for function inverses? – The Pointer Jul 29 '18 at 19:34
• Yes (see answer below). In the case of elements of a group $ab=e$ implies $ba=e$, also in the case of multiplication of square matrices $AB=I$ implies $BA=I$ – Peter Jul 29 '18 at 19:36
• @Peter Ok, thank you for the clarification. – The Pointer Jul 29 '18 at 19:37
• In the case of maps you should always verify $f\ o\ g$ AND $g\ o\ f$ – Peter Jul 29 '18 at 19:38

If $gof$ and $fog$ are both identity functions, then $f$ and $g$ are inverses of each other.