Let $R$ be a ring and $M\in R$ an ideal. It is well known that $R/M$ is a field if and only if $M$ is a maximal ideal of $R$. The proof is outlined below:
Let $a\in R/M$ such that $a\notin M$. Then, as $M$ is a maximal ideal, there has to exist $b\in R$ such that $ab+rm=1$, where $r\in R$. Also, $b\notin M$ (otherwise $ab\in M$, which would imply $1\in M$, making $M=R$). This implies $b\in R/M$ and $b$ is not the identity element of $R/M$. Hence, for every $a\in R/M$, its inverse $b$ also exists in $R/M$.
I was wondering how does this imply that there exists a unique inverse for every element $a\in R/M$? I tried to prove by contradiction: let $ab_1+r_1m_1=ab_2+r_2m_2=1$. This implies $a(b_1-b_2)=r_2m_2-r_1m_1$. Hence $a(b_1-b_2)\in M$. How does this contradict anything? Even if we say that $M$ is a prime ideal, it is entirely possible that $b_1-b_2\in M$, although $b_1,b_2\notin M$.
Thanks in advance!