f is a morphism:
f(i+j)=(i+jmoda,i+jmodb)=(imoda,imodb)+(jmoda,jmodb)=f(imodn)+f(jmodn)
f is injective:
It is enough to see kerf={0modn}
If imodn∈kerf⟹f(imodn)=(0moda,0modb)⟹i≡0moda⟹a∣i⟹i=0modb⟹b∣i⟹lcm(a,b)∣i⟹n∣i⟹i≡−modn.
f is surjective:
Zn has n elements
Za has a elements
Zb has b elements
⟹Za×Zb has ab=n elements.
Fact: if A,B are sets with n elements, and there exists an injective function f:A→B, then it is surjective as well.
Therefore, f is a bijection, so it is an isomorphism. □