If we have that f and f o g (that is, f(g) ) are both injective, must then g be injective?

I find that this is false and I show it with an example, where I have

Here I have that f and f o g are injective but g is not, hence g does not have to be injective.

Is this a correct way to show this at all?