i found this question Show by example that this need not be true if we do not assume that the groups are finitely generated but i have doubts in my minds
Let $G, H,$ and $K$ be finitely generated abelian groups. If $G \times K \cong H \times K$, show that $G \cong H$. Show by example that this need not be true if we do not assume that the groups are finitely generated.
My attempt :$$\prod_{i=1}^\infty \Bbb Z\times(\mathbb{Z}\times\Bbb Z)= \prod_{i=1}^\infty\Bbb Z\times(\Bbb Z^2).$$ but in the given linksquestion answer has given $$\prod_{i=1}^\infty \Bbb Z\times(\mathbb{Z}\times\Bbb Z)= \prod_{i=1}^\infty\Bbb Z\times(\Bbb Z).$$
im confusing how $(\Bbb Z)=(\mathbb{Z}\times\Bbb Z)$??? i thinks its should be $(\Bbb Z^2)=(\mathbb{Z}\times\Bbb Z)$
They are not asserting that $\def\Z{\mathbb Z}\Z\times \Z=\Z$. However, it is the case that $$ \left(\prod_{i=1}^\infty \Z\right)\times\Z\times\Z\cong \left(\prod_{i=1}^\infty \Z\right)\times\Z $$ To prove these groups are isomorphic, all you need is an isomorphism. Recalling that $\prod_{i=1}^\infty \Z$ consists of infinite sequences of integers $(z_1,z_2,\dots)$, the isomorphism from the LHS to the RHS is $$ \Big((z_1,z_2,\dots),x,y\Big)\mapsto \Big((x,z_1,z_2,\dots),y\Big). $$ To put this non-rigorously, if you take an infinite sequence of integers and add an extra two integers to the end, it is the same as taking an infinite sequence of integers and adding an extra one integer to the end. Even more crudely, $\infty+2=\infty+1$.