Let $M_1$, $M_2$, and N be manifolds of dimensions $m_1$, $m_2$, and $n$ respectively. Prove that a map $(f_1,f_2)$: $N$ -> $M_1\times M_2$ is smooth ($C^\infty$) if and only if $f_i$: $N$ ->$M_i$ i=1,2 are both smooth.
Attempted answer in the -> direction:
Let $p\in N$ and $(U,\phi)$ be a chart around $p$ in $N$. Let $(V,\psi)$ be a chart around of $(f_1,f_2)(p)$ in $M_1\times M_2$ and $(V_i,\psi_i)$ be a chart around of $f_i(p)$ in $M_i$. We know $\pi_i \circ \psi \circ (f_1,f_2) \circ \phi^{-1}$ is smooth because the projection is smooth and by hypothesis $\psi \circ (f_1,f_2) \circ \phi^{-1}$ is smooth.
(This is the part that doesn't convince me)
$\pi_i \circ \psi \circ (f_1,f_2) \circ \phi^{-1} = \psi_i \circ \pi_i \circ (f_1,f_2) \circ \phi^{-1}$. Therefore, $\pi_i \circ (f_1,f_2) = f_i$ is smooth.
I would like to know if this attempted answer in the -> direction is correct and how does the other direction goes.