Let $f : A \rightarrow B$ be an arbitrary function. (a) Prove that if $f$ is a bijection (and hence invertible), then $f^{−1}(f(x))=x \ \forall x \in A$, and $f(f^{−1}(x))=x \:\:\forall\:\: x \in B$. 
(b) Conversely, show that if there is a function $g : B \rightarrow A$, satisfying $g(f(x)) = x \:\:\forall \:\: x \in A$, and $f(g(x)) = x \:\: \forall \:\:x \in B$ then $f$ is a bijection, and $f^{−1} = g$.
Apologizes for the poor formatting.
This makes sense logically, the composition of $f$ and $f^{-1}$ is always going to be the input but I am not sure how to formally prove this . 
 A: a)  is almost a definition.
$f:A\to B$ is a function.  That means for every $x \in A$ then there is a $w_x \in B$ so that $f(x) = w_x$.  That's .... not anything deep.  That's just what a function is. (But my notation may seem strange to you.)
$f$ is a bijection so it is invertible.  That means by definition that for any $y\in B$ that there is exactly one $x_y \in A$ so that $f(x_y) =y$.
So for any $x \in A$ there is a unique $w \in B$ so that $f(x) = w$.  And for $w \in B$ there is a unique $z= f^{-1}(w)\in A$ so that $f(z) = w = f(x)$.  But if that value is unique and $f(x)$ is also equal to $w$ that means $z=f^{-1}(w) = x$.
So $f^{-1}(f(x)) = f^{-1}(w) = x$.
A: To make sense of the question, note that for $f: A \to B$,  $f^{-1}(P)$ represents the inverse image of a set $P\subseteq B$ under $f$. If $f(x)$ is treated as the set $\{f(x)\}$, then, by definition of inverse image,
$$f^{-1}(\{f(x)\}) = \{\ a : f(a)=f(x),\ a \in A \}$$
Since $f$ is a bijection, it is injective. Therefore,
$$f(a)=f(x)\implies a=x\\ \implies f^{-1}(\{f(x)\})=\{x\}, \forall\ x \in A\\$$
You can prove that $f(f^{-1}(x))=x, \ \forall\ x \in B$, similarly.
For the second part, observe that $g(f(x))=x, \forall\ x \in A,$ is a bijective function. $g(f(x))$ is injective $\implies f$ is injective and $g(f(x))$ is surjective $\implies g$ is surjective. Similarly, $f(g(x))=x, \forall\ x \in B,$ is a bijective function. $f(g(x))$ is injective $\implies g$ is injective and $f(g(x))$ is surjective $\implies f$ is surjective.
Thus, if such a $g$ exists, then both $f$ and $g$ are bijective. Let the inverse of $f$ be denoted by $f^{-1}$,
$$f(g(x))=x, \forall\ x \in B\\
\implies f^{-1}(f(g(x))=f^{-1}(x),\ \forall\ x \in B\\
\implies g(x)=f^{-1}(x),\ \forall\ x \in B$$
