If $A$ is an integral domain and $B \in M_{m×n}(A)$, $C\in M_{n×m}(A)$ satisfy that $BC = I_m$, $CB = I_n$, then $n = m$. Definitions:
Let $A$ be a unitary ring and $m, n$ non-zero natural numbers. An $m \times n$ matrix over $A$ is a map $B : \{1, . . . , m\} \times \{1, . . . , n\} \rightarrow A$. We will write $(b_{ij})$ instead of $B(i, j)$ and also $B = (b_{ij})$. We will call $M_{m\times n}(A)$ the set of all $m \times n$ matrices over $A$.
The identity matrix of order $n$ is the $n\times n$ scalar matrix whose components of the main diagonal are equal to $1$. We will represent it by $I_n$.
A matrix $C \in M_n(A)$ is regular if it is a unit of the ring $M_n(A)$, that is, if there is a matrix $C^{-1}\in M_n(A)$ such that $CC^{−1} =C^{−1}C = I_n$.
An integral domain is a domain without zero divisors.
A division ring as a unit ring in which $1 \not= 0$ and where every non-zero element has an inverse for the product.
If $D$ is a division ring, the $D-$modules are called vector spaces
Question:

I need to prove that if $A$ is an integral domain and $B \in M_{m×n}(A)$, $C\in M_{n×m}(A)$ satisfy that $BC = I_m$, $CB = I_n$, then $n = m$, $B$ and $C$ are regular and $C = B^{−1}$.

My attempt:
Let $K$ be the field of quotients of $A$. Then $M_{m\times n}(A)M_{n\times m}(A)$ can be considered as a subring of $M_{m}(K)$, where an element of $M_{m\times n}(A)M_{n\times m}(A)$ is $BC$ such that $B\in M_{m\times n}$ and $C\in M_{n\times m}$. I will consider that $BC=I_m$ (this is in the statement). Also, I am going to fix a basis of the $K$ vector space $K^m$ and the $K$ vector space $K^n$. Based on this prefixed base, I will build the linear applications $f:K^m\rightarrow K^n$ and $g:K^n\rightarrow K^m$ whose matrices in the associated base is $B$ and $C$ respectively. Then the matrix associated with $f\circ g$ is $I_m$ (since $BC=I_m$). So $f$ is a monomorphism. Then $\dim(K^n)\leq \dim(K^m)$ that is $n\leq m$. Repeating the same steps, but changing $n$ to $m$, we arrive at $m\leq n$, and then it follows that $n=m$. Therefore $f,g$ are isomorphisms, so $B,C$ are regular, and one is the inverse of the other by definition.
Some additional considerations:
I have defined the sub ring $M_{m\times n}(A)M_{n\times m}(A)$ because when I do the composition $f\circ g$ I get a mapping $f\circ g: K^ m\rightarrow K^m$ and the matrix associated with this composition must be an element of $M_m(K)$, and as $M_{m\times n}(A)M_{n\times m}(A) \subset M_m(K)$ , so $BC$ is a matrix that can be associated with composition functions.
I also consider that the composition $(f\circ g)(x)$ is $g(f(x))$.
EDITED:In the text it mentions that to demonstrate what I am looking at in this post, use steps similar to the following demo:
If $A$ is an integral domain and $B, C\in M_n(A)$ satisfies $BC = I_n$,
then $B$ and $C$ are regular and $C = B^{-1}$.
Demostration:
Let $K$ be the field of quotients of $A$. Then $M_n(A)$ can be considered as a subring of $M_n(K)$. Let's fix a base of space vector $K^n$ and consider the linear maps $f, g : K^n \rightarrow K^n$ whose matrices in the basis considered are $B$ and $C$ respectively. So the matrix of $f \circ g$ is $I_n$, which means that $f \circ g$ is the identity map. From here I know
it follows that $f$ is a monomorphism, so $dim Im (f) = dim K^n = n$. So
we have that $Im (f) = K^n$, then $f$ is an isomorphism and $B$ it is regular. Multiplying by $B^{−1}$ in $BC = I_n$ we obtain that $C = B^{−1}$.
 A: Here's a simple proof for any commutative ring with identity that isn't the zero ring.
Motto: understand the Linear Algebra result by working over a field then turn it into a result about polynomials to get the result over an arbitrary commutativie ring.
$\mathbf x:=\begin{bmatrix}
x_1 \\
\vdots \\
x_{nm}\\
x_{nm+1}\\
\vdots \\
x_{2nm}\end{bmatrix}$ and $R:= \mathbb Z\big[\mathbf x\big]$
consider $B', M' \in R^{m\times n}$
where $b_{1,1}'=x_1 \text{ ; }b_{2,1}'=x_2\text{ ; }b_{m,1}'= x_{m}\text{ ; }b_{1,2}'= x_{m+1} $ and so on and the same for $M$ except each $x_i$ index is incremented by $nm$
$C':=(M')^T$
Suppose for contradiction that $n\neq m$
WLOG we assume that $n\gt m$, then conclude $\det\big(C'B'\big) = 0$
justification:
(i) $R$ is an integral domain so adjoin inverses to get a field and recognize $C'B'$ is $n\times n$ with rank $\leq m\lt n$ hence determinant is zero.  The determinant definition only requires ring operations (no division) hence   $\det\big(C'B'\big) \in R$ so conclude $\det\big(C'B'\big)=0$ when working over a ring or
(ii)  The determinant is zero for arbitrary substitution homomorphism $R\mapsto \mathbb C$ so by principle of permanence of identities conclude $\det\big(C'B'\big) = 0$
now consider the substitution homomorphism $\phi: R\longrightarrow R'$ where $R'$ is an arbitrary commutative ring and $x_1\mapsto b_{1,1}$ and, $x_2\mapsto b_{2,1}$ so forth to recover matrices in the original post.
$I_n = CB$
$\implies 1 $
$= \det\big(CB\big)$
$=\sum_{\sigma \in \text{Perm(n)}}\phi\big((C'B')_{\sigma(1),1}\big)\phi\big((C'B')_{\sigma(2),2}\big)\dots\phi\big((C'B')_{\sigma(n),n}\big)\cdot \phi\big(\text{sign}(\sigma)\big)$
$= \sum_{\sigma \in \text{Perm(n)}}\phi\big((C'B')_{\sigma(1),1}(C'B')_{\sigma(2),2}\dots(C'B')_{\sigma(n),n}\cdot \text{sign}(\sigma)\big)$
$= \phi\big(\sum_{\sigma \in \text{Perm(n)}}(C'B')_{\sigma(1),1}(C'B')_{\sigma(2),2}\dots(C'B')_{\sigma(n),n}\cdot \text{sign}(\sigma)\big)$
$=\phi\Big(\det\big(C'B'\big)\Big)$
$= \phi(0)$
$= 0$
conclude: $1=0$ which is a contradiction and implies $n=m$.
A: The ring $A$ contains a maximal ideal $m$ (assuming $A$ is non-zero) so that $k=A/m$ is a field*. Consider the matrices $B'$ and $C'$ in $M_{m\times n}(k)$, respectively $M_{n\times m}(k)$, given by applying the homomorphism $A\rightarrow A/m$ entrywise to $B$, respectively $C$. Then $B'C'=I_m$ and $C'B'=I_m$. Since $k$ is a field, we have reduced to the case that $A$ is a field, so that now using linear algebra we can show $m=n$.
* It is common for integral domains to be assumed commutative, though I notice that you have not stated that in your definition. In that case, we can only get a maximal left or right ideal, and $A/m$ is not a ring, so the proof does not work. The proof fails as the result is not actually true unless we assume $A$ is commutative.
Extra note:
I have just seen that the OP refer's to the 'field of quotients' of the domain $A$. If your domain is not commutative, then there is no field of quotients because a field is commutative! Moreover, the domain may not be a subring of a division ring as discussed here
Smallest skew-field containing a non-commutative ring.. Only what are called Ore domains will have a division ring of quotients.
A: After reviewing some definitions and seeing some examples, I think I have found the solution (it seems a bit tedious):
We set the bases $D,{D\ ^\prime}$ of the $K-$ vector spaces $K^m$ and $K^n$ respectively.
We consider the bijections $\phi_D:K^m\to K^m$ and $\phi_{D\ ^\prime}:K^n\to K^n$ that to each vector $v\in K^m,w \in K^m$ assigns its coordinates in the base $D, D\ ^\prime$ respectively.
Given the isomorphisms $M_D^{D\ ^\prime}:Hom_K(K^m,K^n)\to Mat_{m\times n}(K)$ and $M_{D\ ^\prime}^D: Hom_K(K^n,K^m)\to Mat_{n\times m}(K)$, if we consider the subrings $Mat_{m\times n}(A)$ and $Mat_{n\times m} (A)$ of $Mat_{m\times n}(K)$ and $Mat_{n\times m}(K)$ respectively, then $(M_D^{D\ ^\prime})^{-1} [Mat_{m\times n}(A)]$ is a subring of $Hom_K(K^m,K^n)$ and $(M_{D\ ^\prime}^D)^{-1}[Mat_ {n\times m}(A)]$ is a subring of $Hom_K(K^n,K^m)$ . We choose a linear mapping $f$ of the subring $(M_D^{D\ ^\prime})^{-1}[Mat_{m\times n}(A)]$ and another linear mapping $g$ of the subring $( M_{D\ ^\prime}^D)^{-1}[Mat_{n\times m}(A)]$ such that
$M_D^{D\ ^\prime}(f)M_{D\ ^\prime}^D(g)=I_m$
(it also holds that $M_D^{D\ ^\prime}(f)\in Mat_{n\times m}(A)$ and $M_{D\ ^\prime}^D(g)\in Mat_{ m\times n}(A)$)
We define the linear maps $ f:K^m\to K^n$ given by $f(v)=\phi_{D\ ^\prime}^{-1}[\phi_D(v)M_D^{D\ ^ \prime}(f)]$ and $g:K^n\to K^m$ given by $g(f(v))=\phi_{D}^{-1}[\phi_{D\ ^\prime}(f(v))M_{D\ ^\prime}^{D}(g)]=\phi_{D}^{-1}\{\phi_{D\ ^\prime}(\phi_{D\ ^\prime}^{-1}[\phi_D(v)M_D^{D\ ^\prime}(f)])M_{D\ ^\prime}^{D}(g)\}=\phi_D^{-1}\{[\phi_D(v)M_D^{D\ ^\prime}(f)]M_{D\ ^\prime}^D(g)\}=\phi_D^{-1}\{\phi_D(v)M_D^{D\ ^\prime}(f)M_{D\ ^\prime}^D(g)\}$
Since $M_D^{D\ ^\prime}(f)M_{D\ ^\prime}^D(g)=I_m$ we have $\phi_D^{-1}\{\phi_D(v)M_D^ {D\ ^\prime}(f)M_{D\ ^\prime}^D(g)\}=\phi_D^{-1}\{\phi_D(v)I_m\}=v$, but we also know that the product of the matrices $M_D^{D\ ^\prime}(f)M_{D\ ^\prime}^D(g)$ is equal to $M_D^D(f \circ g)$, so which also holds that $\phi_D^{-1}\{\phi_D(v)M_D^{D\ ^\prime}(f)M_{D\ ^\prime}^D(g)\}=\phi_D^{-1}\{\phi_D(v)M_D^D(f\circ g)\}=(f\circ g)(v)$ and since both expressions are equal, then we have $(f\circ g ) (v)=v$ from which it follows that $f$ is injective. Therefore, the dimension of the image of $f$, that is, the dimension $f[K^m]$ is less than the dimension of $K^n$, which is equivalent to saying that $m\leq n$. Changing $m$ for $n$ in all of the above mentioned, and applying the same steps, we arrive at $n\leq m$. So $m=n$, and we can apply the theorem discussed in the publication, which finally proves the theorem sought.
If anyone finds any errors please let me know.
I have used $Mat_{m\times n}(K)$ because it is the nomenclature that I normally use and in the reading that I am reviewing, it is also often called $M_{m\times n}(K)$.
