Lemma 2.1 on page 19 of Munkres’ Topology 2E is stated as follows.
Lemma 2.1
Let $ f:A→B$. If there are functions $ g:B→A $ and $ h:B→A $ such that $ g(f(a))=a $ for every $ a∈A $ and $ f(h(b))=b $ for every $ b∈B,$ then $ f $ is bijective and $ g=h=f^{-1}.$
My attempt to proof is as follows.
Proof:
Since $ g:B→A $ is a function and $ g(f(a))=a $ for every $ a∈A, f(x)=f(y) ⇒ g(f(x))=g(f(y)) ⇒x=y\; ∀x∈A $ and $ ∀ y∈A. $
Hence, $ f $ is injective.
Since $ h:B→A $ is a function and $ f(h(b))=b $ for every $ b∈B$, we have $∀b∈B,∃a∈A $ such that $ h(b)=a $ and $ f(a)=f(h(b))=b. $
Hence $ f $ is surjective.
So, $f $ is bijective and it follows that $g=h=f^{-1}$.∎
I’d like to request you to check the above proof and correct if you don’t mind. Although there is already a similar question and answers, I'd like to keep mine as a duplicate.