the identity matrix is unique let A be an $m\times n$ matrix. Prove that there are unique matrices  $I_m$ and $I_n$ such that :
$$I_mA=AI_n=A$$
Actually I can't prove the uniqueness here,any help is appreciated.
Thanks

Let us first address the question as it was asked: for some (i.e., for a given) $A$,
$$I_m A = A I_n = A. \tag{*}$$
Let $X_k$ denote any matrix of order $k$, and let
$$A = \operatorname{diag}(1, 0, \dots, 0) = \begin{bmatrix}
1 & 0 & \dots & 0 \\
0 & 0 & \dots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \dots & 0
\end{bmatrix}.$$
Then any
$$I_m = \operatorname{diag}(1, X_{m-1}) = \begin{bmatrix} 1 & 0 \\ 0 & X_{m-1} \end{bmatrix}, \quad I_n = \operatorname{diag}(1, X_{n-1}) = \begin{bmatrix} 1 & 0 \\ 0 & X_{n-1} \end{bmatrix}$$
will satisfy $(*)$. This means that for some $A$, the statement in the question is not true.
Let us now address what the question should have been:

If $(*)$ is true for any (complex or real) matrix $A$ of order $m \times n$, then $I_m$ and $I_n$ are unique.

We observe only $I_m$, as the proof for $I_n$ is equivalent.
Let us define a sequence of matrices:
$$A_k := \operatorname{diag}(\underbrace{0, \dots, 0}_{k-1}, 1, \underbrace{0, \dots, 0}_{m-k}) \in \mathbb{F}^{m \times m},$$
where $\mathbb{F} = \mathbb{C}$ or $\mathbb{F} = \mathbb{R}$. Descriptively, $A_k$ is constructed form a zero matrix of order $m \times m$ be replacing its $k$-th diagonal element with $1$.
Then $I_m A_k$ differs from a zero matrix only in the $k$-th column, which is equal to the $k$-th column of $I_m$. Given that $I_m A_k = A_k$, we see that the $k$-th column of $I_m$ is equal to the $k$-th column of $A$, i.e., it is equal to
$$\begin{bmatrix} 0 \\ \vdots \\ 0 \\ 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix}\!\!
\begin{array}{l}
\left.{ \vphantom{ \begin{array}{c} 0 \\ \vdots \\ 0 \end{array} }}\right\}k-1 \\ \vphantom{0} \\ \left.{ \vphantom{ \begin{array}{c} 0 \\ \vdots \\ 0 \end{array} }}\right\}m-k \end{array}.$$
Going through $k=1,2,\dots,m$, we get that $I_m = \operatorname{diag}(1,1,\dots,1)$, so it is unique.
We do the same with $A I_n = A$, only this time we're working with the rows of $I_n$.
