TITLE: Why does the ring $A$ need to be commutative for $Hom_A(X,X')$ to be an $A$-module?
QUESTION [6 upvotes]: Refer to Lang's "Algebra" second paragraph from top, p. 122.
Let $A$ be a ring and $X$, $X^'$ be $A$-modules. 
Let $Hom_A(X,X')$ be the set of $A$-homomorphisms from $X$ to $X'$.
It is mentioned that if $A$ is commutative, then we can
make $Hom_A(X,X')$ into an $A$-module by defining
$(\alpha f)(x) = \alpha f(x)$ for $\alpha \in A$, $f \in Hom_A(X,X')$
and $x \in X$, whereas if $A$ is not commutative, then we can only
regard $Hom_A(X,X')$ as an abelian group. The question is: why do we 
need the commutativity property to have a well-defined operation of $A$
on $Hom_A(X,X')$ as above? What goes wrong if we remove commutativity?

REPLY [5 votes]: For the function $\alpha f$ to be a module homomorphism, we need it to satisfy
$$(\alpha f)(x+y) = (\alpha f)(x) + (\alpha f)(y)$$
and
$$(\alpha f)(\lambda x) = \lambda (\alpha f)(x).$$
The first condition is not a problem, but the second condition may fail if $R$ is not commutative: let $\alpha$ and $\lambda$ be two elements of $R$ such that $\alpha \lambda\neq \lambda\alpha$. Then
$$(\alpha f)(\lambda x) = \alpha \Bigl(f(\lambda x)\Bigr) = \alpha\Bigl(\lambda f(x)\Bigr) = \alpha\lambda f(x);$$
but
$$\lambda(\alpha f)(x) = \lambda\Bigl(\alpha f(x)\Bigr) = \lambda\alpha f(x).$$
We have no warrant for asserting that $\alpha\lambda f(x) = \lambda\alpha f(x)$ for all $x$, so $\alpha f$ need not be a module homomorphism when $R$ is not commutative.