Let $G_1$ and $G_2$ be subgroups of a group $G$.
Assume that $G$ is isomorphic to $G_1\times G_2$.
Then is it necessary that $G_1$ and $G_2$ are normal in $G$?
Clealry $G_1\cong G_1\times \{e\}\trianglelefteq G_1\times G_2$ and $G_2\cong \{e\}\times G_2\trianglelefteq G_1\times G_2$.
So it is easy to infer that $G$ contains normal subgroups $H_1$ and $H_2$ such that $H_1\cong G_1$ and $H_2\cong G_2$. But does that force $G_1,G_2\trianglelefteq G$?
Let $H$ be a non-normal subgroup of $G_1$ and $G_2\cong H$. Then $G=G_1\times G_2$ is isomorphic to $G_1\times H$ yet $H$ is not normal in $G$.
Edit: If the isomorphism $G_1\times G_2\to G$ is given by $(g_1,g_2)\mapsto g_1g_2$, then the answer is yes, $G_1$ is normal in $G$.