Properties of functions throughout different domain/codomains. Let f : S → T and g : T → U, then g ∘ f is injective implies that f is injective, and g ∘ f is surjective implies that g is surjective. Do these still hold if the functions are defined differently? 
For example f : S → T and g : T → S
I'm trying to show that if f and g are defined as in the line above, then if g ∘ f is injective and f ∘ g is surjective, then both compositions are bijective. 
 A: If $g \circ f$ is injective, then so is $f$, and if $f \circ g$ is surjective, then so is $f$, hence $f$ is bijective.
Suppose $g(x)=g(y)$, then since $f$ is bijective, there are unique $x',y'$ such that $f(x')=x, f(y') = y$, and so $g(f(x')) = g(f(y'))$, and since $g \circ f$ is injective, we have $x'=y'$ and so $x=y$, hence $g$ is injective.
Hence $f \circ g$ is injective, and so $ f \circ g$ is injective, hence bijective. Since $g = f^{-1} \circ (f \circ g)$, it follows that $g$ is bijective, and hence so is $g \circ f$.
A: This can be solved by making use of the following rules:


*

*A function $i:A\rightarrow B$ is injective iff a function
$h:B\rightarrow A$ exists such that $1_{A}=h\circ i$.

*A function $s:B\rightarrow A$ is surjective iff a function
$k:A\rightarrow B$ exists such that $1_{A}=s\circ k$.
Now let it be that $f:S\rightarrow T$ and $g:T\rightarrow S$ are
functions such that $g\circ f$ is injective and $f\circ g$ is surjective.
Then $1_{S}=h\circ g\circ f$ for some $h:S\rightarrow S$ and $1_{T}=f\circ g\circ k$
for some $k:T\rightarrow T$.
Then $h\circ g=h\circ g\circ1_{T}=h\circ g\circ f\circ g\circ k=1_{S}\circ g\circ k=g\circ k$.
Then $1_{S}=h\circ g\circ f=g\circ k\circ f$ (so $g$ is surjective)
and $1_{T}=f\circ g\circ k=f\circ h\circ g$ (so $g$ is injective).

The rules are not difficult to prove and I will not do that here (unless you ask for that explicitly). On the first rule there is one exception: the unique (empty) function $i:\emptyset\rightarrow B$ is vacuously an injection. However, if $B\neq\emptyset$ then no function $h:B\rightarrow\emptyset$ exists.
A nice way to remember: put the little sentence: $$\mathbf{s\circ i=id}$$ in your mathematical luggage. Here $\mathbf{s}$ stands for surjective, $\mathbf{i}$ for injective and $\mathbf{id}$ for identity. 
