Ring isomorphic to endomorphism ring I have conflicting notes that say different things and I wanted some clarity. One says that $\text{End}_R (R) \cong R $ as rings but another says that if $M$ is a free $R$-module if rank $n$ then $\text{End}(M) \cong M_n (R^{\text{opp}}) $ which would seemingly imply that since $R$ is a module of rank 1 that $\text{End}(R) \cong R^{\text{opp}} $ which differs slightly from the first.
 A: This occurs when one changes sides (or not) for the action of the endomorphisms. Suppose $M$ is a right $R$-module and that we write endomorphisms on the left (changing sides) so
$$ \mathrm{End}_R(M) = \{\theta\in\mathrm{End}_{\mathbb Z}(M)\mid\theta(mr)=\theta(m)r\textrm{ for all $m\in M$ and $r\in R$}\}, $$
In this case, when $M$ is free of rank $n$, we get
$$ \mathrm{End}_R(M) \cong \mathrm M_n(R). $$
For example, if $n=1$, then the isomorphism is given by rescaling, so $\lambda\in R$ corresponds to the endomorphism $m\mapsto\lambda m$, and the composition of endomorphisms $\lambda\circ\mu$ gives
$$ (\lambda\circ\mu)(m) = \lambda\mu m= (\lambda\mu)(m). $$
If instead we take a left $R$-module and write endomorphisms on the left (same side), then
$$ \mathrm{End}_R(M) = \{\theta\in\mathrm{End}_{\mathbb Z}(M)\mid\theta(rm)=r\theta(m)\textrm{ for all $m\in M$ and $r\in R$}\}. $$
In this case, when $M$ is free of rank $n$, we get
$$ \mathrm{End}_R(M) \cong \mathrm M_n(R^{\mathrm{op}}). $$
Again, if $n=1$, then $\lambda\in R$ gives the endomorphism $1\mapsto\lambda$, and $r=r1\mapsto r\lambda$. Composition of endomorphisms thus gives
$$ (\lambda\circ\mu)(1) = \lambda(\mu) = \mu\lambda = (\mu\lambda)(1). $$
For this reason I often find it better to change sides when considering the module structure and the endomorphisms, and since I prefer to write $\theta(m)$ I usually write endomorphisms on the left, and so consider right modules.
