Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 5.1 Exercise 5.1.3
Solution: Let $x = (x_j)$ and $y = (y_j)$.
If $j \in I$, then $$(xy)_j = x_j y_j = x_j \cdot 1 = 1 \cdot x_j = y_jx_j = (yx)_j.$$ If $j \in K$, then $$(xy)_j = x_j y_j = 1 \cdot y_j = y_j \cdot 1 = y_jx_j = (yx)_j.$$ Otherwise, $$(xy)_j = x_j y_j = 1 \cdot 1 = y_j \cdot x_j = (yx)_j.$$ Thus $xy = yx$.