Problem: I am currently learning group theory and am not sure if the following is true: let $A \cong A'$ and $B \cong B'$, is $A \times B \cong A' \times B'$ (here "$\times$" denote the external direct product)?
Attempt: Since $A \cong A'$ and $B \cong B'$, there exist isomorphisms $f_A: A \rightarrow A'$ and $f_B: B \rightarrow B'$. Let $f: A \times B \rightarrow A' \times B'$ be defined by $f(a,b) = (f_A(a),f_B(b))$ for every $a \in A, b \in B$. Then $f$ is an isomorphism.
I know that for finite group $A$ and arbitrary group $B, C$, we have $A \times B \cong A \times C \iff B \cong C$, but I cannot find anything as general as stated in this problem, so where did I go wrong in my proof?