Direct product of two normal subgroups 
Let $A$ and $B$ be normal subgroups of a group  $G$ such that $A \cap B = \langle e \rangle$ and $AB = G$. Prove that $A \times B \cong G$

Attempted proof:
Define $f : A \times B \rightarrow G$ by $f(a,b) = ab$. From a proof of another exercise, the hypothesis of this problem implies $ab = ba$. Therefore, $f(a,b) = f(b,a)$.
Since $f((a,b) \cdot (c,d)) = f(ac, bd) = (ac)(bd) = a(cb)d = a(bc)d = (ab)(cd) = f(ac) f(bd)$ for $a,c \in A$ and $b,d \in B$, it follows that $f$ is a homomorphism.
Now I need to show that $f$ is bijective (so show both injectivity and surjectivity of $f$), so that $f$ is an isomorphism from $A \times B$ to $G$. 
Am I on the right track? 
 A: Hints: You will need $AB=G$ to prove surjectivity and $A\cap B=\{e\}$ to prove injectivity.

Since you still didn't fix the issue with $f(b,a)$ and $f(ac)$ being meaningless expressions, let me elaborate on this:
You want a homomorphism $f:A\times B\to G$, so you can put a pair $(a,b)\in A\times B$ in $f$ an get some element $f(a,b)\in G$.


*

*Writing $f(b,a)$ for $b\in B, a\in A$ implies you could put a pair $(b, a)\in(B\times A)$ in $f$, which is not the case, since $f:A\times B \to G$, $\color{red}{\text{not }f:B\times A\to G}$.

*Writing $f(ac)$ for $a,c\in A$, thus $ac\in A$, implies you could just put an element of $A$ in $f$, which is not the case, since $f:A\times B\to G$, $\color{red}{\text{not }f:A\to G}$.


What you want is for $(a,b), (c,d) \in A\times B$ to have
$$ f((a,b)\cdot(c,d)) = f(a,b)\cdot f(c,d),$$
where by definition of the operation in $A\times B$ we have $(a,b)\cdot(c,d)=(ac,bd)\in A\times B$.
Now you suggest to define $f$ as
\begin{align}
f : A\times B &\longrightarrow G, \\
(a,b) &\longmapsto ab.
\end{align}
Using this definition, we can evaluate both sides of the equation we want to prove for $f$ to be a homomorphism:
\begin{align}
f((a,b)\cdot(c,d)) &= f(ac, bd) = acbd, \\
f(a,b)\cdot f(c,d) &= ab\cdot cd = abcd.
\end{align}
Now, since $c\in A$, $b\in B$ where $A,B$ are normal in $G$ and $A\cap B=\{e\}$ you conclude from your previous problem that
$$
acbd = a(cb)d = a(bc)d = abcd.
$$
Put everything together and you obtain
\begin{align}
f((a,b)\cdot(c,d)) &= f(ac, bd) = acbd = a(cb)d \\&= a(bc)d = abcd = ab\cdot cd = f(a,b)\cdot f(c,d).
\end{align}
A: Perhaps more succint and going the other way around (easier, imo):
$$G=AB\implies \forall\,x\in G\;\;\exists\,a_x\in A\,,\,b_x\in B\;\;s.t.\;\;x=a_xb_x$$
Now, if also $\;x=a'_x+b'_x\;,\;\;a'_x\in A\;,\;\;b'_x\in B\;$ , then we'd have that
$$a_xb_x=a'_xb'_x\implies a'^{-1}_xa_x=b'_xb_x^{-1}\in A\cap B=1\implies\;\ldots$$
and we get injectivity of $\;G\to A\times B\;$ defined by $\;x\mapsto (a_x,b_x)\;$
Surjectivity is trivial, of course.
