by null(g) do you mean the nullspace, or the nullity of g (because one is a vector space, the other is an integer)?

the dimension of ker(gf) might not be dim(ker(g)∩f(V)). for example suppose V = W = Z = R^2,

and g(x,y) = (x,y), and f(x,y) = (x,0). then ker(gf) = ker(f) = {(0,y) : y in R}, which has dimension 1, but ker(g)∩f(V)

= {(0,0)} ∩ {(0,y): y in R} = {(0,0)}, which has dimension 0.

use the rank-nullity therorem instead. it may be helpful to consider the linear transformation g*:f(V)-->Z g*(w) = g(w),

(g restricted to the range of f) and to prove first that null(g*) ≤ null(g).