If following is true, give a proof. If it is false, give a counterexample.
(a)If $f$ and $g$ are injective, then $g\circ f$ is injective
(b) if $g\circ f$ is surjective then then $g$ is surjective
Question:
I think both are true for specific case that $f:A\rightarrow{B},g:B\rightarrow{C}$,
but this only include functions s.t. co-domain(f) = domain(g),
I'm not sure for more general cases $f:A\rightarrow{R},g:B\rightarrow{R}$
what I get so far:
a)Proof.(for general cases)
let $f:A\rightarrow{R},g:B\rightarrow{R},f \circ g:C\rightarrow{R}$
(s.t. A is the domain that f is defined on
and B is the domain that g is defined on)
Assume f and g are injective
Show $g\circ f$ is injective
By assumption
Have $\forall x_1,x_2\in A,x_1\neq x_2\rightarrow{f(x_1)\neq f(x_2)}$
and $\forall x_3,x_4\in B,x_3\neq x_4\rightarrow{g(x_3)\neq g(x_4)}$
We want to show that:
$\forall x_5,x_6\in C,x_5\neq x_6\rightarrow{g(f(x_5))\neq g(f(x_6))}$
...(but I don't know how to prove)
b)Proof.
let $f:A\rightarrow{R},g:B\rightarrow{R},f \circ g:C\rightarrow{R}$
Assume $\forall y \in R, \exists x_1\in C, g(f(x_1))=y$
Show $\forall y \in R, \exists x_2 \in B, g(x_2)=y$
...
Definitions I'm using:
$f:A\rightarrow{B}$:
$f$:domain $\rightarrow$ co-domain
domain:
Subset of R that f is defined on
(for example, domain of $\frac{1}{x}$ is R without $0$)
co-domain:
R as default
range:
Outputs of f as a subset in co-domain
injective:
Let $f:A\rightarrow{B}$
f is injective iff $\forall x_1,x_2\in A,x_1\neq x_2\rightarrow{f(x_1)\neq f(x_2)}$
surjective:
Let $f:A\rightarrow{B}$
f is surjective iff $\forall y \in B,\exists x\in A,f(x)=y$
(In another word:Its range is same as its co-domain)