Integral domain $\implies$ $x\to ax$ is injective. $$R \mbox{ integral domain then in } ax=bx \implies ax-bx = 0 \implies (a-b)x = 0 \implies a=b \mbox{ or } x = 0$$
But what is this $x=0$? I'm supposed to prove only that $a=b$. What can I do to eliminate the hippotesis that $x=0$?
 A: This map is in general not injective unless $a$ is non-zero.  Certainly if you take $f: \mathbb{Z} \rightarrow \mathbb{Z}$ by $f(n)=0n$, every integer is mapped to $0$, so it fails to be injective.  
I suppose it is worth noting that if $R$ is the zero-ring, $R=\{0\}$, then $f(x)=0x$ is actually injective.  But if there are at least two elements in $R$, it is not injective since everything gets mapped to zero.
I think your main confusion is that it is the $a$ which is fixed, not the $x$. So let $a$ be a non-zero element and let $f: R \rightarrow R$ be a map defined by $f(x)=ax$.  Then if $f(x)=f(y)$, we have $ax=ay$.  Then since $R$ is an integral domain, $a(x-y)=0$, so $a=0$ or $x-y=0$.  But $a \neq 0$, so $x-y=0$ which implies $x=y$ so $f$ is injective.
A: The function  $f:R\to R$ is defined by $f(x)=ax$ forall $x\in R$.
$f(x)=f(y)\implies ax=ay\implies a(x-y)=0\implies$  either $a=0$ or $x=y$
If $a=0\implies f(x)=0\forall x$ in that case $f$ is not injective.
I think you should have $a\neq 0$ in your hypothesis
