Is $g$ the unique function with this property? Prove/Disprove: Let $A$ and $B$ be sets and let $f : A \to B$ be a function. If there is a
function $g : B \to A$ such that $g\circ f = \operatorname{id}_A$, then $g$  is the unique function with this property.
I'm confused. Would $f^{-1}$  be another function? Or is this problem saying $g= f^{-1}$? 
 A: Consider 
$A=\{3,7\}$, 
$B=\{3,7,9001\}$ 
and $f$ defined by 
$f(3):=3$
$f(7):=7$.
As long as $g$ maps $3$ back to $3$ and $7$ back to $7$, the function $g\circ f$ will be the identity on $A$, while there are two options to where $g$ may map $9001$ to.
A: Let $A = \{1,2\}$ and $B = \{a,b,c\}$. Define $f: A \to B$ by $$f(1) = a, f(2) = b.$$ Define $g_1,g_2: B \to A$ by
$$g_1(a) = 1, \;  g_1(b) = 2, \;g_1(c) = 1$$
and
$$ g_2(a) = 1, \; g_2(b) = g_2(c) = 2.$$
Then, $g_1 \circ f = g_2 \circ f$ but $g_1 \neq g_2$.
A: Yes, the problem is asking you to prove that if $f^{-1}$ (f inverse) exists, then that inverse is unique. 
Say there are two such functions, $g_1 : B \mapsto A$ and $g_2 : B \mapsto A$
such that $g_1 \circ f = g_2 \circ f = \text{id}\, A$. Then we need to show that $g_1$ is the same function as $g_2$, that is, for all $b \in B$, $g_1(b) = g_2(b)$.  
You can easily show this if $f$ is surjective, since for every $B \in B$ there is some $a \in A : f(a) = b$ and then we have $g_1(b) = a$ and $g_2(b) = a$.
But if $f$ is not surjective, the proposition does not hold.
