Modules, Invariant Dimension Property, Direct Sum 
Let R be a ring with no zero divisors such that for all $r,s \in R$ there exist $a,b \in R$, not both zero, with ar + bs = 0.
(a) If $R = K \oplus  L$ (module direct sum), then K = 0 or L = 0.
(b) If R has an identity, then R has the invariant dimension property.

This question is from my module theory assignment and I am struck on the problem.
(a) I am completely stumped by this and I don't have any idea.
(b)  for all $r,s\in R$ there exist $a,b \in R$ , not both 0 with ar + bs = 0. Now, this is a thing I deduced: Let X be the basis. Then $X={x_1 , ... ,x_m}$ be the basis. Now, let m be odd , then for all {$x_1,x_2$}, {$x_3, x_4$},...{$x_{m-2} ,x_{m-1}$} there exists r and s for each couple such that $rx_{p}+ sx_{q} =0$  and $rx_{m+1}=0$. Then, $x_{m+1}$ will also be 0 as R doesn't have a zero divisor. Now, if m is even then all such elements will be made 0 by m/2 couples which means that any such set X in Linearly Independent.
So, I think 1 is the only element in the basis and any other basis must contain only 1  element and hence invariant dimension property.

For part (b), recall that to show $R$ has the invariant dimension property, we need to show that every basis for a free $R$-module $F$ has the same cardinality. In other words, if $R^m\cong R^n$, $m=n$.
The method you are trying to use does not quite work. Let $x_1,x_2\in F$. Since $x_1,x_2$ are not elements of $R$, we cannot assume that there exists $a,b\in R$ such that $ax_1+bx_2 = 0$, so the proof breaks down a bit.
This question has been posted a lot on this site, and I don't think I have seen the following proof for it, so I will post a way to proceed:
Suppose $F$ is a free module on $R$ such that both $F\cong R^n$ and $F\cong R^m$. This implies that $R^n\cong R^m$. Without loss of generality, suppose $m>n$. By taking the module quotient by $R^{n-1}$, we see that $R\cong R^{m-n+1}$, so $R\cong R\oplus R^{m-n}$ as an $R$-module. By part (a), either $R=0$ or $R^{m-n} = 0$, a contradiction. This implies that $m=n$, so $R$ has the invariant dimension property.
