End(M) for cyclic R-module M is a commutative ring where R is a PID.

Notice $\phi(x)=r_\phi x$ for some $r_\phi\in R$, since $\phi(x)\in M=Rx$; similarly $\alpha(x)=r_\alpha x$ for some $r_\alpha\in R$. Then we can calculate $$\alpha(\phi(x))=\alpha(r_\phi x)=r_\phi\,\alpha(x)=r_\phi(r_\alpha x)=r_\alpha(r_\phi x)=r_\alpha\,\phi(x)=\phi(r_\alpha x)=\phi(\alpha(x))$$


Since $M$ is cyclic, there exists a surjective homomorphism of $R$-modules $\psi:R\rightarrow M$.

The kernel of $\psi$ is an ideal of $R$, call it $I$.

We then have $M \simeq R/I$ as $R$-modules. Hence $\operatorname{End}_R(M)$ is isomorphic to $\operatorname{End}_R(R/I)$.

However, an $R$-linear endomorphism of $R/I$ is the same as an $R/I$-linear endomorphism of $R/I$, hence we have $\operatorname{End}_R(R/I) = \operatorname{End}_{R/I}(R/I)$.

But for any commutative ring $S$, the endomorphism ring $\operatorname{End}_S(S)$ is canonically isomorphic to $S$ itself: we have maps $u:\operatorname{End}_S(S)\rightarrow S$ sending any $\phi$ to $\phi(1)$, and $v:S\rightarrow \operatorname{End}_S(S)$ sending any $s$ to the endomorphism $x\mapsto sx$.

In particular, $\operatorname{End}_{R/I}(R/I) \simeq R/I$ is a commutative ring.


The condition "$R$ is PID" is not needed.