# If an ideal $I$ contains a non-zero-divisor then $\mathrm{End}_R(I)$ is commutative

How can I prove that if $I$ is an ideal of a commutative ring $R$ that contains a non-zero-divisor then $\mathrm{End}_R(I)$ is commutative?

-

Let the non-zerodivisor be $x$.
First we claim $End_R(xR)$ is commutative. Clearly each $f,g\in End_R(xR)$ is determined by its image of $x$. So, say, let $f(x)=xr$ and $g(x)=xs$. Then $f(g(xt))=xtsr=xtrs=g(f(xt))$, and so $fg=gf$ for all $f,g\in End_R(xR)$.
Now suppose, $F,G\in End_R(I)$. If $FG\neq GF$, there exists a $z$ such that $FG(z)-GF(z)\neq 0$. Multiplying on the right with $x$, $FG(zx)-GF(zx)\neq 0$. However, this is impossible since $F$ and $G$ must commute when restricted to $xR$!
So, $End_R(I)$ is commutative.
The maps in Andrea's post are not $R$ linear, although they are $k$ linear. If you assume $\psi$ to be $R$ linear, for example, $\psi(x)=y$ and $\psi(y)=0$ would imply that $\psi(xy)=y^2$ and $\psi(xy)=0$ and thus $y^2=0$ (which it is not). – rschwieb May 7 '12 at 0:50