I have to prove that function $f: A \to B$ is bijective if exists function $g: B \to A$ where $\forall x \in A$ $g(f(x))= x$ $\wedge$ $\forall y \in B$ $f(g(y))=y$
So I know that function $g$ is inverse to $f$, and I also know that if exists inverse function to $f$ than $f$ is bijective. I think that I have to prove that function $g$ is inverse function to $f$. But I don't know how to prove this formally.
Given that $f(a)=f(a')$, then $g(f(a))=g(f(a'))$, hence $a=a'$, this proves that $f$ is one-to-one.
Given that $b\in B$, then $f(g(b))=b$, so $g(b)$ is such that $f(g(b))=b$, this proves that $f$ is onto.