If $H$, $K$ are characteristic subgroups of $G$, when is $\operatorname{Aut}(H\times K) = \operatorname{Aut}(H) \times \operatorname{Aut}(K)$ true? If $H$, $K$ are characteristic subgroups of $G$, when is $\operatorname{Aut}(H\times K) = \operatorname{Aut}(H) \times \operatorname{Aut}(K)$ true?
What if $H$, $K$ are not characteristic subgroups? 
In general, under what conditions is it true that $\operatorname{Aut}(H\times K) = \operatorname{Aut}(H) \times \operatorname{Aut}(K)$, for subgroups $H$, $K$ of $G$?
 A: Regarding no restriction on two subgroups $H,K$ of $G$, but finiteness; if $(|H|,|K|)=1$ then $$Aut(H\times K)=Aut(H)\times Aut(K)$$ By setting $H=K=\mathbb Z_p$- so we have $(|H|,|K|)>1$- this property fails to be correct. Morover, it seems that if $G=H\times K$ then:

Let $f\in Aut(G)$. So $$f_H=f|_H\in Aut(H),~~f_K=f|_K\in Aut(K)$$ On the other hand, if $$f_H\in Aut(H),~~f_K\in Aut(K)$$ you may set $f=f_H\times f_K:HK\to HK$ with a rule (?) then $f\in Aut(G=HK)$ (?). Now assume that $$\psi:Aut(H)\times Aut(K)\to Aut(G),~~\psi(f_H,f_K)=f_H\times f_K\\\\ \phi: Aut(G)\to Aut(H)\times Aut(K),~~\psi(f)=(f_H, f_K)$$ Try to show that these are inverses to each other.

A: I don't think the original question specified that $G = H \times K$. Without this specification, the answer is quite different (as Mariano indicated in the comments).
Consider $G = D_8 \times Q_8$. Then $H=Z(D_8) \times 1$ and $K=1 \times Z(Q_8)$ are both characteristic subgroups of $G$. The automorphism group of $G$ has order 3072, the automorphism group of $H \times K$ has order 6, and the image of the automorphism group of $G$ inside the automorphism group of $H \times K$ has order 1. In particular, the map $\phi$ from Babak's answer need not be injective or surjective if $G \neq H \times K$.

Let's look at homomorphisms of direct products.
Proposition: There is a correspondence between $\newcommand{\Hom}{\operatorname{Hom}}\Hom( H \times K, G )$ and $\Hom(H,G) \times \Hom(K,G)$ which is injective in general, and bijective if $G$ is abelian.
Proof: Suppose $f:H \times K \to G$ is a homomorphism. it turns out $f$ is also a direct product: $f((h,k)) = f((h,1) \cdot (1,k)) = f((h,1)) \cdot f((1,k))$. Define $f_H : H \to G : h \mapsto f((h,1))$. Since $(h_1,1)\cdot(h_2,1) = (h_1\cdot h_2,1)$ we get $f_H( h_1 \cdot h_2) = f_H(h_1) \cdot f_H(h_2)$ so $f_H$ is also a homomorphism. Similarly $f_K$ is a homomorphism.
Conversely, suppose we have homomorphisms $f_H : H \to G$ and $f_K : K \to G$ and $G$ is abelian, define $f: H \times K \to G : (h,k) \mapsto ( f_H(h), f_K(k) )$. Since $(h_1,k_1) \cdot (h_2,k_2) = ( h_1\cdot h_2, k_1 \cdot k_2)$ one has $f((h_1,k_1) \cdot(h_2,k_2)) = f((h_1,k_1)) \cdot f((h_2,k_2))$ and $f$ is also a homomorphism.
In summary: the correspondence takes $f$ to $(f_H,f_K)$ as in the first paragraph, and takes $(f_H,f_K)$ to $f$ as in the second paragraph as long as $G$ is abelian. $\square$
Proposition: There is a 1-1 correspondence between $\Hom(G,H \times K)$ and $\Hom(G,H) \times \Hom(G,K)$.
Proof: If $f:G \to H \times K$ is a homomorphism, define $f^H:G \to H:g\mapsto h$ and $f^K:G \to K: g \mapsto k$ where $f(g) = (h,k)$. It is not hard to show $f^H$ and $f^K$ are homomorphisms.
Conversely, if $f^H:G \to H$ and $f^K:G \to K$ are homomorphisms, then define $f:G \to H \times K : g \mapsto (f^H(g), f^K(g))$. It is not hard to show $f$ is a homomorphism.
In summary, the 1-1 correspondence takes $f$ to $(f^H,f^K)$ as in the first paragraph, and takes $(f^H,f^K)$ to $f$ as in the second paragraph. $\square$
Combining these we can handle the case where both the domain and range are direct products. Note that $(f^H)_K = (f_K)^H$ so I just write $f^H_K$.
Proposition: There is a correspondance between $\Hom(H \times K)$ and $\Hom(H,H) \times \Hom(H,K) \times \Hom(K,H) \times \Hom(K,K)$ that is injective in general, and bijective if $H,K$ are abelian.
Proof: $f \mapsto (f^H_H, f^K_H, f^H_K, f^K_K)$. The reverse direction holds if $H,K$ are abelian. $\square$
Now automorphisms are more complicated in general, but if $H$ and $K$ are reasonable independent (contain no isomorphic direct factors), then one has a nice expression given in Arturo's answer.
However, if $\Hom(H,K) = \Hom(K,H) = 0$, then we have diagonal matrices and automorphisms are easy to understand.
A: it's the first time i try to answer my question ! i don't know if this will make the question closed or what will happen ,but i have a trial to prove this statement and want to share it with you ,and i hope there is no logical mistakes in it .
to prove $Aut(H \times K) = Aut(H) \times Aut(K) $
1- i prove that $Aut(H \times K) \subseteq Aut(H) \times Aut(K) $
let $M \in Aut(H \times K)$ then $M=(M_1,M_2)$
$M_1(H) \times M_2(K) = (M_1,M_2)(H\times K)=M(H\times K)=H\times K $
so , $M=(M_1,M_2) \in Aut(H)\times Aut(K)$
so, $Aut(H \times K) \subset Aut(H) \times Aut(K) $

2- i prove that $Aut(H) \times Aut(K)  \subseteq Aut(H \times K) $
let $M\in Aut(H)\times Aut(K) so M=(M_1,M_2) where M_1 \in Aut(H)$ and $M_2 \in Aut(K) $
$M(H\times K)=(M_1,M_2)(H\times K)=(M_1(H)\times M_2(K))=(H,K)$
so$M\in Aut(H\times K)$
so , $Aut(H) \times Aut(K)  \subseteq Aut(H \times K) $ 
using 1,2 ,we conclude that ,$Aut(H \times K) = Aut(H) \times Aut(K) $ 
i think that this is the Baddest proof i have ever written ! i don't know if it even makes sense ! 
