Theorem 18.4 of Munkres’ Topology 
(Maps into product) let $f: A\to X\times Y$ be given by equation $f(a)=(f_1 (a), f_2 (a))$ then f is continuous if and only if the function $f_1 : A\to X$ and $f_2 :A\to Y$ are continuous.

My attempt: let $x\in A$. Let $U\in \mathcal{N}_{f_1 (x)}$ and $V\in \mathcal{N}_{f_2 (x)}$. Since $f$ is continuous at $x$, $\forall P\in \mathcal{N}_{f(x)}, \exists Q\in \mathcal{N}_x$ such that $f(Q)\subseteq P$. Clearly $U\times V\in \mathcal{B}\subseteq \mathcal{T}_{X\times Y}$ and $(f_1 (x), f_2 (x))\in U\times V$. So $U\times V \in \mathcal{N}_{f(x)}$. Take $Q\in \mathcal{N}_{x}$ so that $f(Q)\subseteq U\times V$. $f(Q)=\{ f(z)\in X\times Y| z\in Q\} \subseteq U\times V$. So $f(z)=(f_1 (z),f_2 (z))\in U\times V, \forall z\in Q$. Thus, $f_1 (Q)=\{ f_1(z)| z\in Q\} \subseteq U$ and $f_2 (Q)=\{ f_2(z)| z\in Q\} \subseteq V$. Hence $f_1$ and $f_2$ are continuous.
Conversely, let $x\in A$ and $V\in \mathcal{N}_{f(x)}$. Which means $(f_1 (x), f_2 (x))\in V$ and $V=\bigcup_{i\in I} (U_i \times V_i)$, where $(U_i \times V_i) \in \mathcal{B}, \forall i\in I$. So $(f_1 (x), f_2 (x)) \in (U_j \times V_j)$, for some $j\in I$. So $U_j \in \mathcal{N}_{f_1 (x)}$ and $V_j \in \mathcal{N}_{f_2 (x)}$. Since $x\in A$ and $f_1$ & $f_2$ are continuous, $\exists R,S \in \mathcal{N}_{x}$ such that $f_1 (R)\subseteq U_j$ and $f_2 (S)\subseteq V_j$. Take $R\cap S \in \mathcal{N}_{x}$ so that $f(R\cap S)=\{ f(z)\in X \times Y| z\in R\cap S\}$. Since $z\in R \cap S$, $f(z)=(f_1(z), f_2(z))\in f_1 (R)\times f_2 (S)\subseteq U_j \times V_j \subseteq \bigcup_{i\in I} (U_i \times V_i)=V$. Thus, $f(R\cap S)\subseteq V$. Hence $f$ is continuous. Is this proof correct?

Summary: There are two different approach to show $(\Rightarrow )$ and ($\Leftarrow$) implication.
(1) Munkres’ approach: Note $f_1 =\pi_1 \circ f$ and $f_2=\pi_2 \circ f$. Let $U\in \mathcal{T}_X$. Let $V\in \mathcal{T}_Y$. Clearly, $\pi_{1}^{-1}(U)= U\times Y \in \mathcal{T}_{X\times Y}$ and $\pi_{2}^{-1}(V)= X\times V \in \mathcal{T}_{X\times Y}$. Thus $\pi_1$ and $\pi_2$ are continuous. By hypothesis of theorem $f$ is continuous. $f_1$ and $f_2$ are composite of continuous function, hence continuous.
(2) Sourav Ghosh: In my opinion, this is a clever approach. Rely on $f^{-1}(M\times N)=f_1^{-1}(M) \cap f_2^{-1}(N)$, where $M\subseteq X$ & $N\subseteq Y$, fact.
Conversely($\Leftarrow$),
(1) Munkres’ approach: suppose $f_1$ and $f_2$ are continuous. Let $U\times V\in \mathcal{B}$. Note $f^{-1}(U\times V)=f_1^{-1}(U) \cap f_2^{-1}(V)$. Since $f_1$ and $f_2$ are continuous, $U\in \mathcal{T}_X$ and $V\in \mathcal{T}_Y$, we have $f^{-1}(U\times V) \in \mathcal{T}_A$. Thus $f$ is continuous.
(2) Henno Brandsma: By theorem 15.2, $\pi_i^{-1}(U) \in S$, where $S=\{ \pi_1^{-1}(U)| U\in \mathcal{T}_X\} \cup \{ \pi_2^{-1}(V)|V\in \mathcal{T}_Y\}$ is subbasis for product topology on $X\times Y$(Proof: Theorem 15.2 of Munkres Topology) . To prove the continuity of $f$ it is suffice to show that inverse image of each subbasis element is open. $f^{-1}(\pi_i^{-1}(U)) = (\pi_i \circ f)^{-1}(U)= f_i^{-1}(U)\in \mathcal{T}_A$, since $f_i$ is continuous for $i=1,2$.
 A: 
(Maps into product) let $ f:A\to X×Y$ be given by equation
$f(a)=(f_1(a),f_2(a))$  then $f$ is continuous if and only if the function
$ f_1:A\to X $  and $ f_2:A\to Y$ are continuous

Proof : Given : $ f_1:A\to X $  and $ f_2:A\to Y$ are continuous.
To show : $f:A\to X×Y$ is continuous.
Choose an open set  $W\in \tau_{product}$.
Then $W=U×V $ where $U \in \tau_{X}$ and $V\in \tau_{X}$
Then, $f^{-1}(W) =f_1^{-1}(U) \cap f_2^{-1}(V)$
As $f_1^{-1}(U), f_2^{-1}(V)$ are open in $A$ as pre images of open sets under continuous maps.
Hence, $f^{-1}(W)$ is open in $A$.
Similarly if $f:A\to X×Y$ is continuous, then both $ f_1:A\to X $  and $ f_2:A\to Y$ are continuous.
Choose, $U\in\tau_{X}$.
\begin{align} f^{-1}(U×Y) &=f_1^{-1}(U) \cap f_2^{-1}(Y)\\& =f_1^{-1}(U)\cap A\\&=f_1^{-1}(U)\end{align}
As $U×Y\in \tau_{product}$ and $f:A\to X×Y$ is continuous $f^{-1}(U×Y)\subset A$ is open.
Hence, $f_1:A\to X$ is continuous.
Similarly , it can be easily shown that $f_2:A\to Y$ is also continuous.
A: Let $\pi_i^{-1}[U]$ be a subbasic open set, $i\in \{1,2\}$, $U$ open. Then $f^{-1}[\pi_i^{-1}[U]] = (\pi_i \circ f)^{-1}[U] = f_i^{-1}[U]$ is also open when both $f_i$ are. Hence $f$ is continuous (inverse images of subbasic sets are open). The other direction follows from the fact that compositions of continuous maps are continuous and $\pi_i \circ f = f_i$.
