Q:

A bijection of Cartesian products

If $A, B, C$ are nonempty sets prove that there exists a bijection
  between $(A \times B) \times C$ and $A \times (B \times C)$. If there
  is a bijection between $A$ and $B$ and between $B$ and $C$ prove that
  there is a bijection between $A$ and $C$.

How can I prove this? 
The Cartesian product of two sets $A$ and $B$ is defined to be the set of all ordered pairs $(a,b)$ where $a \in A$ and $b \in B.$ 

A:

For the first part: The set $(A\times B)\times C$ has elements of the from $((a,b),c)$, whereas $A\times (B\times C)$ has elements of the form $(a,(b,c))$. Can you think of a natural map between these two sets?
For the second part: If $f:A\to B, g:B\to C$ are bijective, then what about $g\circ f:A\to C$?

