I'm trying to make sure that I have correctly proved Munkres' Lemma 2.1, which is left to the reader. The lemma states:
Let $f: A \to B$. If there are functions $g: B \to A$ and $h: B \to A$ such that $g(f(a)) = a$ for every $a$ in $A$ and $f(h(b)) = b$ for every $b$ in $B$, then $f$ is bijective and $g = h = f^{-1}$.
Here is my attempted proof.
We will show that $f$ is bijective by showing that it is both surjective and injective. Fix $b \in B$. Then $h(b) = a$ for some $a \in A$. Applying $f$, we obtain $f(a) = f(h(b)) = b$, so $f$ is surjective. Now, suppose $f(a) = f(a')$ for some $a,a' \in A$. Applying $g$, we obtain $g(f(a)) = g(f(a'))$ and hence $a = a'$, so $f$ is injective and hence bijective.
Now, it suffices to demonstrate that $g = h$. We have $$g \circ \mathrm{id}_B = g \circ (f \circ h) = (g \circ f) \circ h = \mathrm{id}_A \circ h = h.$$ Therefore, we have $f \circ g = f \circ h = \mathrm{id}_B$ and $g \circ f = h \circ f = \mathrm{id}_B$, so $g = h = f^{-1}$, as required.
The thing I'm most concerned about is whether I've shown that $g = h = f^{-1}$. This requires showing two things, I believe: (1) that $g$ and $h$ are equal and (2) that they both operate as both left and right inverses. By showing that $g$ is also a right inverse, I've shown it is a two-sided inverse, and similarly by showing that $h$ is also a left inverse. I haven't shown that any two-sided inverse is necessarily equal to both $g$ and $h$, so the equality to $f^{-1}$ is not immediately clear to me, which suggests I should also prove (3) any other inverse is necessarily equal to $g$ and $h$.