I need a proof of the following fact: if a group $G=M \times N$ is the direct product of subgroups $M$ and $N$ such that $\lvert M \rvert$ and $\lvert N \rvert$ are relatively prime, then $\mathrm{Aut}(G) = \mathrm{Aut}(M) \times \mathrm{Aut}(N)$.
This is the way the result is recalled on some lecture notes I am reading, I think $M$ and $N$ are implicitly supposed finite (maybe $G$ also?) otherwise this does not make sense.
This should be rather standard (it is used but not proven here), but I've taken a quick look on Rotman, Roman and Robinson but none of them seems to prove this. Do you have a reference for the proof/can you share here a proof you know?
Thanks
Let $n=|M|, m=|M|$ there exists integers $a,b$ such that $am+bn=1$. Let $x\in M$, write $f(x,1)=(u,v)$. We have $f((x,1)^{am})=f(x^{am},1)=f(1,1)=(1,1)=f(u^{am},v^{am})$.
We have $u^{am}=(u^m)^a=1$, $v^{am}=v^{1-bn}=vv^{-bn}=v$, we deduce that $(1,1)=(1,v), v=1$. Similarly, we show that for every $y\in N$, $f(1,y)=(1,l)$. This implies that $f(x,y)=(g(x),h(y))$ and $f^{-1}(x,y)=(g'(x),h'(y))$. $g'$ is the inverse of $g$ and $h'$ the inverse of $h$.