Let $f: X \rightarrow Y$ and $g: Y \rightarrow X$
If $f \circ g$ is injective and $g$ is surjective - is $f$ injective?
I am trying to learn the way of prooving things. So I'll give it a try and please correct at every wrong step.
I assume that the given statement ist true.
So first I give the condition that $g$ is surjective: $\forall y \in Y : \exists x \in X:g(y)=x$
So two different $y$-values can point to the same $x$-value:
Let $y_1, y_2 \in Y, y_1 \neq y_2 : \exists x \in X : g (y_1)=x $ and $g (y_2)=x$
Next I want to connect the fact that $f \circ g$ is injective with the surjective condition of $g$:
Let $z_1, z_2 \in X \quad$ Because $z_1, z_2 \in X$ it is true that $z_1, z_2 \in g(y)$ thus: $$f \circ g(y_1) = f \circ g (y_2)$$ $$f(z_1) = f(z_2)$$ $$z_1 = z_2$$
So $f$ is injective.