  We prove that the centralizer Cen(f) in Hom_R(M,M) of a nilpotent
endomorphism f of a finitely generated semisimple left R-module M (over an
arbitrary ring R) is the homomorphic image of the opposite of a certain
Z(R)-subalgebra of the full m x m matrix algebra M_m(R[z]), where m is the
dimension (composition length) of ker(f). If R is a local ring, then we provide
an explicit description of the above Cen(f). If in addition Z(R) is a field and
R/J(R) is finite dimensional over Z(R), then we give a formula for the
Z(R)-dimension of Cen(f). If R is a local ring, f is as above and g is an
arbitrary element of Hom_R(M,M), then we give a complete description of the
containment Cen(f) in Cen(g) in terms of an appropriate R-generating set of M.
Using our results about nilpotent endomorphisms, for an arbitrary (not
necessarily nilpotent) linear map f in Hom_K(V,V) of a finite dimensional
vector space V over a field K we determine the PI-degree of Cen(f) and give
other information about the polynomial identities of Cen(f).
