Let $R$ be a ring and $M$ an $R$-module. An $R$-Endomorphism is of $M$ is a $R$-morphism $f: M \rightarrow M$. Now I'd like to show that $\operatorname{End_R}(M)$ with pointwise addition and composition as multiplication is an $R$-algebra if $R$ is commutative.
By definition of an $R$-algebra we must show that $\operatorname{End_R}(M)$ is an $R$-module and that
$r(ab)=(ra)b=a(rb)$ holds for all $r \in R$ and $a,b \in M$.
$\operatorname{End_R}(M)$ is an $R$-module since
$ (r+s)f(x)=f((r+s)x)=f(rx+sx)+rf(x)+rg(x)$,
$r((f+g)(x))=r(f(x)+g(x))=rf(x)+rg(x)$,
$r(sf(x))=(rs)f(x)$ since M is an $R$-module.
For $r,s \in R, f,g \in \operatorname{End_R}(M), x \in M$.
Now I have to show that $\operatorname{End_R}(M)$ is even an $R$-algebra.
$r((f\circ g)(x))=r(f(g(x))=f(rg(x))=f\circ(rg(x))$.
Is this right? I'm pretty confused because I did not use anywhere that $R$ is commutative.
You have to use commutativity for the fact that for $ f \in \text{End}_R(M) $ and $r \in R$ $rf$ is still a morphism of $R$-Modules i.e $rf(r'm)=r' r f(m)$ for all $ m \in M, r' \in R $. Note that this is missing from your proof. This is not necessarily the case but if $R$ is commutative you have $rf(r'm)=rr'f(m)=r'rf(m)$.