Answer
See solution
Work Step by Step
$CA=I_n$
$CAD=I_nD=D$
$AD=I_m$
$CAD=CI_m=C$
Thus, $CAD=D=C$ and $D=C$
If D and C are equal, they must have the same size. For products $I_nD$ and $CI_m$ to be equal, D and C must have the same number of columns and rows and $n=m$.