Derivate that a function is injective

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

$\displaystyle A = \{a,b,c,d\}, B=\{a,b,c,d\}, C=\{1,2,3,4\}$

$\displaystyle g: A \Longrightarrow B, f: B \Longrightarrow C, f o g: A \Longrightarrow C$

$\displaystyle g(a) = a, g(b) = b, g(c) = c, g(d) = c$

$\displaystyle f(a) = 1, f(b) = 2, f(c) = 3, f(d) = 4$

$\displaystyle f(g(a)) = 1, f(g(b)) = 2, f(g(c)) = 3, f(g(d)) = 3$

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?