Invariants to distinguish between non-homeomorphic spaces $X, Y$ where there exist opposing bijective continuous maps $f: X\leftrightarrows Y: g$ I've learnt about the harsh reality that the existence of opposing bijective continuous maps $f: X\leftrightarrows Y: g$ doesn't imply that $X$ and $Y$ are homeomorphic. For this post, let's just call topological spaces $X, Y$ "weakly homeomorphic" if there exist continuous bijection $f : X \to Y$ and $g : Y \to X$ (without requiring $f^{-1}$ and $g^{-1}$ to be continuous).
Suppose $X,Y$ are weakly homeomorphic and path connected. I am unconvinced that the fundamental groups $\pi_1(X)$ and $\pi_1(Y)$ are necessarily isomorphic. How would I show this?
 A: The answer is a minor modification of an example given here.
Let $X'$ be the disjoint union of countably infinitely many 2-dimensional tori $T_n, n\ge 1$, countably infinitely many rectangles
$R_n=(0,1]\times (0,1], n\ge 1$, and a single cylinder $C=(0,1]\times S^1$. Similarly, let $Y'$  be the disjoint union of countably infinitely many 2-dimensional tori $T_n, n\ge 1$ and countably infinitely many rectangles
$R_n=(0,1]\times (0,1], n\ge 0$. For each $n$ fix a base-point $t_n\in T_n$, $c\in int(C)= (0,1)\times S^1$ and $r_n\in (0,1)\times (0,1)=int(R_n)$. There exist continuous bijections
$$
f_0: (R_0,r_0)\to (C, c), g_0: (C,c)\to (T_1,t_1).
$$
These maps extend to continuous bijections $f': Y'\to X', g': X'\to Y'$, which restrict to homeomorphisms
$$
Y' \setminus R_0\to X'\setminus C, X'\setminus C\to Y' \setminus R_0, 
$$
sending base-points to base-points.  Lastly, form the wedge-sum $X$ of $X'$, by identifying all the base-points in $X'$ and also
the wedge-sum $Y$ of $Y'$, by identifying all the base-points in $Y'$. The continuous bijections $f', g'$ descend to continuous bijections $f: Y\to X, g: X\to Y$.
By the Seifert-Van Kampen theorem, $\pi_1(X)$ is isomorphic to the free product of the groups $\pi_1(T_n)\cong {\mathbb Z}^2, n\ge 1$, and the cyclic group $\pi_1(C)\cong {\mathbb Z}$.  Similarly, $\pi_1(Y)$ is isomorphic to the free product of the groups $\pi_1(T_n)\cong {\mathbb Z}^2, n\ge 1$. Thus, $\pi_1(X)$ is not isomorphic to $\pi_1(Y)$ since the former contains the infinite cyclic group as a free factor and the second does not. (Cf. Exercise 22 on page 250 in "Combinatorial Group Theory" by Magnus, Karrass  and Solitar.) Hence, we obtain an example of two spaces which are weakly homeomorphic but have non-isomorphic fundamental groups.
