How do I show that a map $f$ is a homeomorphism iff all component maps $f_i$ are homeomorphisms? I have the following problem:

Let $I$ be a nonempty index set and let $(M_i,T_{M_i})$ and $(N_i,T_{N_i})$ be topological spaces. Moreover let $f_i:M_i\rightarrow N_i$ be maps. Finally endow $M=\prod_{i\in I} M_i$ and $N=\prod_{i\in I} N_i$ with the product topology. Show that the map $f=\prod_{i\in I} f_i: M\rightarrow N$ is a homeomorphism iff each $f_i$ is a homeomorphism.

Proof
We have just shown that $f$ is continuous iff each $f_i$ is continuous. From the lecture we know that a map $f$ between top. spaces is a homeomorphism iff $f$ is continuous, bijective and open.
$\Rightarrow$ Let us assume that $f$ is a homeomorphism. We need to show that all $f_i$ are continuous, bijective and open. Since $f$ is continuous, we can immediately deduce that all $f_i$ are continuous. Let us denote $p_i:N\rightarrow N_i$ and $q_i:M\rightarrow M_i$ the projection maps. Since $M,N$ are endowed with the product topology we know that $p_i,q_i$ are both open. Thus we get immediately that $p_i\circ f$ is open. But since $p_i\circ f=f_i\circ q_i$ and $q_i$ is open, we can also deduce that $f_i$ has to be open. Now we only need to show that $f_i$ are bijective. We know that the projection map is surjective.
Does it is correct till this point or do I wrote nonsense? (I would do the other inclusion similarly using the fact that $f_i$ are continuous, bijective and open)
But for the bijectivity I have some problems. Could one gave me a hint?
Thank you
 A: If $f$ is bijective assume some $f_j$ is not. Either $f_j$ is not injective and so for some $x \neq y \in M_j$ we have $f_j(x)=f_j(y)$. Add dummy points for all other coordinates and note that "extended" $x$ and $y$ also are mapped by $f$ to the same value, a contradiction. If $f_j$ is not surjective some $q\in N_j$ is not in $f_j[M_j]$ but then stuffing $y$ to a point of $N$ (so we're in both cases making the essential assumption that $M,N \neq \emptyset$ etc.) it also cannot be in $f[M]$, contradiction.
The bijective part is easiest in a way (assuming non-empty products).
If $f_j$ were not open, then for some open $O \subseteq M_j$ we'd have a non-open image, but then $f[\pi_j^{-1}[O]]$ is non-open as $\pi_j[f[\pi_j^{-1}[O]]]= f_j[O]$ is non-open and projections are open maps. (I use the same $\pi_j$ notation for projections on both $M$ and $N$). Continuity can be shown the same way:
$\pi_j[f^{-1}[\pi_j^{-1}[O]]]=f_j^{-1}[O]$ so a non-open pre-image for some $f_j$ would also give one for $f$ etc.
A: $\newcommand{\m}{\mathbf{m}}$As commented, I'll be assuming that all the spaces (including the product spaces) are nonempty.
In particular, I'm fixing two points $\m = (m_i)_i \in M$ and $\mathbf{n} = (n_i)_i \in N$ in the product spaces.

($\Rightarrow$)

But since $p_i\circ f=f_i\circ q_i$ and $q_i$ is open, we can also deduce that $f_i$ has to be open.

This needs a little argument. You would need to show that any open set in $M_i$ can be written as $q_i(U)$ for some open $U \subset M$. Since this is true, it does follow that $f_i$ is open.
Now, you want to show that each $f_i$ is injective. Fix $j \in I$ and let $x_1, x_2 \in M_{j}$ be arbitrary. Suppose $f_{j}(x_1) = f_{j}(x_2)$. Now, consider the elements $\m_1, \m_2 \in M$ which are equal to $\m$ in all coordinates but the $j$-th one, and $(\m_1)_j = x_1$ and $(\m_2)_j = x_2$.
Then, $f(\m_1) = f(\m_2)$. Since $f$ is injective, $\m_1 = \m_2$ and hence, $x_1 = x_2$.
Similarly, to show that $f_j$ is surjective, pick $y \in  N_j$ and define $\mathbf{n}' \in N$ to be equal to $\mathbf{n}$ in all coordinates but the $j$-th one and...

Can you try the other direction now?

Added. How do we see that $f_i$ are open?
Fix $j \in I$. Let $V \subset M_j$ be an arbitrary open set. We wish to show that $f_j[V]$ is open. But note that $V = q_j[U]$, where $U$ is the subset of $M$ defined to be the product of all the $M_i$ except that in the $j$-th coordinate, it is $V$.
Thus, we have $$f_j[V] = (f_j \circ q_j)[U] = (p_j \circ f)[U],$$
which is open since $p_j$ and $f$ are open maps, and $U$ is open (it is a basis element of the product topology).
