I know if $g(f(x))$ is injective, then $f$ is injective and I have no problems proving this, but I also know g is not injective, but my following wrong proof suggests that $g$ is injective.
Proof: If $g(f(x))$ is injective, then if $g(f(x_1))=g(f(x_2))$, then $x_1=x_2$, so $f(x_1)=f(x_2)$ and $y_1=y_2$ for some $y_1$ and $y_2$. Since $g(f(x_1))=g(f(x_2))$ and $f(x_1)=f(x_2)$, so $g(y_1)=g(y_2)$ implies $y_1=y_2$, so $g$ is injective. Can anyone point out where my proof is wrong?