Would anyone mind checking if my proof is ok please?
If $g\circ f$ is monic, so is $f$.
According to my book (R. Goldblatt's Topoi), an arrow $f:a\to b$ in a category $\mathscr C$ is monic if for any parallel pair $g: c\to a$ and $h:c\to a$, $f\circ g=f\circ h$ implies $g=h$.
So we need to show that for any parallel pair $i: c\to a$ and $j:c\to a$, $f\circ i=f\circ j$ implies $i=j$; we start by assuming $f(i(x))=f(j(x))$.
By assumption, we have for all $x$ in $c$, $g(f(i(x)))=g(f(j(x)))$ implies $i(x)=j(x)$.
But since we do have $f(i(x))=f(j(x))$, given the same input $g$ must also give us the same output - hence $g(f(i(x)))=g(f(j(x)))$. This implies $i(x)=j(x)$ - which is exactly what we need.
As noted in the comments, your use of $(x)$ is mistaken. This is the case because not every category has functions as their morphisms.
Here's how a proof should look . . .