Let $f: A \to B $ and $g:B \to A.$
1) Suppose $g \circ f$ is one-to-one. Prove that $f$ is one to one. Does $g$ have to be also one-to-one?
2) Suppose $g \circ f$ is onto. Prove that $g$ is onto. Does $f$ have to be also onto?
On
HINT: The first part of (1) falls into your lap if you just try the most obvious thing.
Suppose that $x,y\in A$, and $f(x)=f(y)$. What can you say about $(g\circ f)(x)$ and $(g\circ f)(y)$? What does this tell you about $x$ and $y$?
For the second part of (1), think about what can happen when there is a $b\in B$ that is not in the range of $f$.
The first part of (2) is also very easy. Suppose that $a\in A$. Then $a=(g\circ f)(x)$ for some $x\in A$. Use this to find an element $b\in B$ such that $g(b)=a$.
The hint for the second part of (2) is the same as for the second part of (1).
Hint: $g \circ f$ being 1-1 means that $g(f(x)) = g(f(y)) \implies x = y.$ Use this directly to show that $f(x) = f(y) \implies x = y.$
To see that $g$ need not be 1-1, consider $f:\{a\} \rightarrow \{a,b\}, a \mapsto a$ and $g:\{a,b\} \rightarrow \{a\}, a \mapsto a, b \mapsto a.$
The other problem is very similar.