Regarding product topology, why is $(X\times Y)\times Z$ homeomorphic to $X\times(Y\times Z)$? I want to set up "identity" function as the homeomorphism.
How to express an element in $(X \times Y) \times Z$? 
Is it $((x,y),z)$? 
Furthermore, when it is mapped to $(x,(y,z))$, can the function be called identity function? 
I am thinking that when $f(x,(y,z))$ belongs to $A \times (B \times C)$, how to show $f^{-1}(A \times (B \times C))=(A \times B) \times C$? 
Thank you very much! 
 A: The map $f\colon (X\times Y)\times Z\to X\times(Y\times Z)$ defined by
$$
f\colon \bigl((x,y),z\bigr)\mapsto\bigl(x,(y,z)\bigr)
$$
is obviously bijective.
The fact that it is continuous is readily established: let $U$, $V$, $W$ be open sets in $X$, $Y$, $Z$ respectively.
Then
$$
f^{-1}\bigl(U\times(V\times W)\bigr)=(U\times V)\times W.
$$
Since also
$$
f\bigl((U\times V)\times W\bigr)=U\times(V\times W)
$$
we have that $f$ and $f^{-1}$ are continuous.
A: One way to prove this result is to use elementary category theory.
Products can be defined in an abstract way and the associative law you wish holds in this general setting.
Coming back to topological spaces, you need to verify that the product of a family of topological spaces is indeed a product in the category of topological spaces, which amounts to verify the universal property defining the product (see again the two wikipedia links given above).
A: You're on the right track. Elements of $(X \times Y) \times Z$ can indeed be written uniquely as $((x,y),z)$, a pair, of which the first element is another pair. 
To prove the homeomorphism, we note that your proposed mapping is certainly a bijection.
So continuity of it, and its inverse, are the only issues, really.
General fact about topological products: a function $f: T \rightarrow X \times Y$ from a space into a product is continuous iff $T: \pi_X \circ f : T \rightarrow X$ and $ T: \pi_Y \circ f : T \rightarrow Y$ are both continuous, where $\pi_X$ and $\pi_Y$ are the projections from the product onto $X$ resp. $Y$.
Let your map be called $F$, from $(X \times Y) \times Z \rightarrow X \times (Y \times Z)$, defined by $F( ((x,y),z) ) = (x, (y,z))$.
Then $F$ is continuous iff $\pi_X \circ F$ and $\pi_{Y \times Z} \circ F$ are continuous.
The former maps $((x,y),z)$ to $x$, and so is just the composition $\pi_X \circ \pi_{X \times Y}$, which is continuous as a composition of continuous projections, one from $(X \times Y) \times Z$ onto $X \times Y$, and then from $X \times Y$ onto $X$.
The map $\pi_{Y \times Z} \circ F$ is continuous (as a map into $Y \times Z$) iff both $\pi_Y \circ \pi_{Y \times Z} \circ F$ and $\pi_Z \circ \pi_{Y \times Z} \circ F$ are continuous, and these can be written again as direct projections or a compositions of projections again (do it!). Conclusion: $F$ is continuous.
Then do a similar song and dance for the inverse, using the universal property again.
