Let $R$ be a commutative ring (with $1$) such that every non-zero divisor in $R$ is a unit (see [Rings in which every non-unit is a zero divisor](https://mathoverflow.net/questions/42647/rings-in-which-every-non-unit-is-a-zero-divisor) for various stabs at what these are called). Let $M$ be a finitely generated $R$-module. 


My question: 



> 
> Can we conclude that every non-zero divisor in $\mathrm{End}(M)$ is a unit?
> 
> 
> 


**For example:** When $M$ is a free module, we have $\mathrm{End}(M) \cong R^{n \times n}$ is a matrix algebra and so every non-zero divisor is a unit (see [Do these matrix rings have non-zero elements that are neither units nor zero divisors?](https://mathoverflow.net/questions/77816/do-these-matrix-rings-have-non-zero-elements-that-are-neither-units-nor-zero-divi)).


A few notes:


1. Even matrix algebras can misbehave when $R$ is non-commutative. Also, if $R$ has a non-zero divisor which is not a unit, then $\mathrm{End}(R)=R^{1 \times 1}=R$ has a non-zero divisor which is not a unit (thus the assumptions on $R$).
2. If $V$ is an infinite dimensional vector space (over some field). Then $\mathrm{End}(V)$ has non-zero divisors which aren't units (thus the "finitely generated" assumption).
3. If the answer to the question is "No" (I'd like a counter-example), then I would like to know under what circumstances $\mathrm{End}(M)$ does have this property. What assumptions on the module will force this to hold? (e.g. This holds when $M$ is a ??? module -- like flat or projective or something.) Or what assumptions on the ring will force this to hold for all modules? (e.g. This obviously holds when $R$ is a field.)
4. Motivation and background: I've been working with a few undergraduates on a related problem. We tripped over this question and I have no idea whether this is true or not (I'm not a ring theorist and have a feeling this may be a difficult question to entirely resolve).


Thanks for reading my question! We (my group of undergrads and myself) appreciate your help!



When does End(M) consist entirely of zero, zero divisors, and units?
Here is a small positive result: If $R$ is Artinian, $End\_R(M)$ is an $R$-algebra which is f.g. as $R$-module, hence Artinian, hence classical (as I call these rings, following Lam).


On the other hand, as soon as the Krull dimension of $R$ is $\geq 1$, $M = R/p$ for a non-maximal prime ideal $p$ will give a counterexample, as in Graham's answer.


**Added**: I think if $R$ is Noetherian (hence semilocal by a theorem of Faith, see Lam's *Lectures on Modules and Rings* theorem 8.31 p. 283), the assertion is true for $M$ f.g. projective (= f.g. flat).  

Because then $R \simeq \prod\_{i=1}^{n} R\_i$ with indecomposable semilocal $R\_i$ with corresponding idempotents $e\_i$, $End\_R(M) \simeq \prod End\_{R\_i}(e\_i M)$ and $e\_iM$ is f.g. projective over $R\_i$. We can thus reduce to the indecomposable case, and here f.g. projectives are free (this remains true without "f.g.", says [Hinohara](http://projecteuclid.org/DPubS?verb=Display&version=1.0&service=UI&handle=euclid.tmj/1178244175&page=record)), so we are done by the OP's second link.


