I will paraphrase Pete Clark's "Commutative algebra" notes (pp. 24-25), available here.
As Julian's answer and Amitesh's comment point out, if $R$ is a commutative ring, then if $R$ was not a field, there would exist a two-sided proper ideal $I$. Then $R/I$ would be a nontrivial $R$-module with $0\not=I=ann(R/I)$, whence $R/I$ would be a nonfree $R$-module.
For the noncommutative case: a ring with no nonzero proper twosided ideals may admit a nonfree module. Prof. Clark constructs an example: I quote,
Noncommutative Remark: If $R$ is a non-commutative ring such that every left $R$-module is free, then the above argument shows R has no nonzero proper twosided ideals, so is what is called a simple ring. But a noncommutative simple ring may still admit a nonfree module. For instance, let $k$ be a field and take $R = M_2 (k)$, the $2\times 2$ matrix ring over $k$. Then $k\oplus k$ is a left R-module which is not free. However, suppose $R$ is a ring with no proper nontrivial one-sided ideals. Then $R$ is a division ring – i.e., every nonzero element of $R$ is a unit – and every $R$-module is free.
At the end he asserts what you have been trying to prove. As mentioned by him in the comments, this is expanded in his noncommutative algebra notes, p.6:
Every left $R$-module is free $\Rightarrow$ $R$ is a division ring:
(We follow an argument given by Manny Reyes on MathOverflow.) Let $I$ be a maximal left ideal of $R$ and put $M = R/I$. Then $M$ is a simple left $R$-module: it has no nonzero proper submodules. By assumption $M$ is free: choose a basis $\{x_i\}_{i\in I}$ and any one basis element, say $x_1$. By simplicity $Rx_1 = M$. Moreover, since $x_1$ is a basis element, we have $Rx_1 \cong R$ as $R$-modules. We conclude that as left $R$-modules $R\cong M$, so $R$ is a simple left $R$-module. This means it has no nonzero proper left ideals and is thus a division ring.
This question is apparently pointed to by similar questions, but lacks a transparent answer. This solution is meant to provide a simple solution to shore up those links.
Suppose that $S^2\neq 0$. Then there exists $a,b\in S$, such that $ab\neq 0$.
The right annihilator $\mathscr r(S)=\{x\in S\mid Sx=\{0\}\}$ is easily checked to be a two-sided ideal for any $s\in S$. The condition in the hypothesis says that this is always either $S$ or $\{0\}$. Our current assumption says $\mathscr r(S)=\{0\}$.
So except for $0$, all other elements $s$ have the property that $Ss=S$. This in turn implies that the left annihilators $\ell (s)=\{x\in S\mid xs=0\}$ are all zero whenever $s$ is nonzero (since they are necessarily left ideals). Finally, this means every nonzero element cancels on the right, since $(x-y)s=0$ implies $x-y=0$ if $s\neq 0$.
Starting again from $Sb=S$, there exists $e\in S$ such that $eb=b$. From $e^2b=eb$ we learn $e=e^2$, and clearly $e\neq 0$. Now let $x\in S$:
- $(xe-x)e=0$ implies $xe=x$ because $e$ can be cancelled off the right.
- If $(ex-x)$ were not zero, then we would be able to cancel it off the right of $e(ex-x)=0$ to get $e=0$, a contradiction, so in fact $ex=x$.
That establishes that $e$ is an identity for the ring.
From there on out it's easy. If $x$ is an arbitrary nonzero element of $S$, we have that $yx=e$ for some $y$, and subsequently that $zy=e$ for some $z$. The usual trick of examining $zyx$ confirms that $x=z$ is the two-sided inverse for $y$, and $y$ is the two-sided inverse for $x$, so $x$ is invertible. That concludes the proof, since every nonzero element has been shown to be invertible.
Best Answer
$(rz)r=r(zr)=r$, thus $r(1-zr)=0$, $zr=1$.
Remark that the fact that $zr=1$ follow from the fact that $R$ does not have divisors of zero: if $ab=0$ $a,b\neq 0$ , since $Ra=R$, $ra=1$, $r(ab)=(ra)b=b=0$. Contradiction.