$g\circ f$ injective $\implies$ $f$ injective
My proof:
Let $X,Y,Z$ be sets and $f: X\to Y$, $g:Y\to Z$ be functions. Since $g\circ f$ is injective, we can conclude that for every $z \in Z$ exists at the most $x\in X$ with $g(f(x))=z$.
We can rewrite $g(f(x))=z \Leftrightarrow f(x)=g^{-1}(z)$. Furthermore, we know $f(x)=y$, so $g(f(x))=z \Leftrightarrow g(y)=z$. Summa summarum, we have $$f(x)=g^{-1}(z) \Leftrightarrow f(x)=g^{-1}(g(y)) \Leftrightarrow f(x)=y$$ which is what we wanted to show.
Is that a valid proof, if not please let me know why! Thanks in advance!
No, you cannot deduce from $g\bigl(f(x)\bigr)=z$ that $f(x)=g^{-1}(z)$ since you have no reason to assume that $g$ has an inverse.
You can prove the statement that you want to prove as follows: if $f(x)=f(y)$, then $g\bigl(f(x)\bigr)=g\bigl(f(y)\bigr)$, and therefore, since we are assuming that $g\circ f$ is injective, $x=y$.