Show that matrix multiplication is associative. That is, show that $(AB)C = A(BC)$ for any matrices $A$, $B$, and $C$ that are of the appropriate dimensions for matrix multiplication.
Solution
To show that two matrices are equal, we need to show that all of their entries are equal. Our plan is thus to show that the $(i,j)$ entry of $(AB)C$ equals the $(i,j)$ entry of $A(BC)$.
Contrasting (1) and (2), we notice that the $k$ index in (1) corresponds to the $BC$ product, and the $k$ index in (2) corresponds to the $AB$ product. To see if (1) and (2) are equal, we would like to use the same indices in the same positions.
Because the indices are dummy variables, we can rename them. In (2), replacing $k$ with $\ell$ gives $$\bigl(A(BC)\bigr)_{ij} = \sum_\ell \sum_m A_{i \ell} B_{\ell m} C_{m j}. \tag{2'}$$
Now replace $m$ with $k$ in (2') to get $$\bigl(A(BC)\bigr)_{ij} = \sum_\ell \sum_k A_{i \ell} B_{\ell k} C_{k j}. \tag{2''}$$
We now see that (1) and (2'') are equal because the sums over $\ell$ and $k$ can be interchanged.