Well-definedness of a function on $\mathbb{Z}/m\mathbb{Z} \otimes \mathbb{Z}/n\mathbb{Z}$ I try to understand André Caldas' answer of the proof of $(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z}) \cong \mathbb{Z}/ \gcd(m,n)\mathbb{Z}$:
In his answer, he defines a map 
$$
  \begin{array}{rlrl}
    g: & \mathbb{Z} & \rightarrow & (\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z})
    \\
       & z          & \to         & z (1 \otimes 1)
  \end{array}
$$
whose kernel contains the ideal generated by $\gcd(m,n)$. Now I would like to elaborate why $\mathrm{ker}(g) \subset \langle \mathrm{gcd}(m,n) \rangle$.
My approach:


*

*Since $\langle \mathrm{gcd}(m,n) \rangle \subset \mathrm{ker}(g)$, the map $g$ factors through a map $$\bar{g}: \mathbb{Z}/\gcd(m,n)\mathbb{Z} \to (\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z}).$$ If I would be able to show that this is an isomorphism, then $\mathrm{ker}(g) \subset \langle \mathrm{gcd}(m,n) \rangle$ follows.

*In the same post, it is claimed that 
$$
f: (\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z} )\to \mathbb{Z}/\gcd(m,n)\mathbb{Z}
$$
defined by $f(a \otimes b) = ab \mod \gcd(m,n)$ is the inverse map of $\bar{g}$ and I am trying to understand why this is the case.
Now I am not sure how much I have to do to show the well-definedness of this map. I think one has to show that if $a,a',b,b' \in \mathbb{Z}$ such that $a = a'$ in $\mathbb{Z}/m\mathbb{Z}$ and $b = b'$ in $\mathbb{Z}/n\mathbb{Z}$, it must be $f(a \otimes b) = f(a' \otimes b')$. But do we have to also check the criteria from the tensor product because the tensor product can also be defined through a quotient? For instance, do I have to check if $f((a+a')\otimes b - a \otimes b - a' \otimes b) = 0$ too?


I would like to mention that although the universal property is nice, I would like to find an explanation without it since this problem was given to us before we learned about the universal property.
Could you please help me with this problem too? Thank you very much!
 A: In general, to define a morphism from $M/N$ to $M'$, one may define a morphism $f$ from $M$ to $M'$ and show that the kernel contains $N$. Then the universal property of the quotient guarantees the existence of a morphism $\overline{f}\colon M/N\to M'$ with $\overline{f}(m+N) = f(m)$.
And to define a morphism from a free module on $X$ to $M'$, one may define a set theoretic function $g\colon X\to M'$, and then the universal property of the free module guarantees a morphism $\overline{g}\colon F(X)\to M'$ such that $\overline{g}(x) = g(x)$ for each $x\in X$ (viewed as an element of $F(X)$.

Since you defined the tensor product as a quotient of the free module on $M\times N$, you can define a map from $M\otimes N$ by defining a set-theoretic function on $M\times N$, then using that to define a morphism from the free module on $M\times N$, and then showing that the bilinear relations lie in the kernel of that map; that will guarantee that the map factors through the tensor product. (This is really nothing more than the universal property for the tensor product).
So to define a map with domain $\mathbb{Z}/m\mathbb{Z}\otimes_{\mathbb{Z}}\mathbb{Z}/n\mathbb{Z}$, you can define a map form the free abelian group with basis $\mathbb{Z}/m\mathbb{Z} \times \mathbb{Z}/n\mathbb{Z}$, and verify that all the "bilinear relations" map to zero.
To that end let $g$ be defined on the set $\mathbb{Z}/m\mathbb{Z}\times \mathbb{Z}/n\mathbb{Z}$ by $g(a,b) = ab\bmod \gcd(m,n)$. Because the elements of $M\times N$ have several different names, you need to verify this is well defined (so if $(a,b)=(a',b')$, then $ab\bmod \gcd(m,n) = a'b'\bmod\gcd(m,n)$). But this is about verifying the set-theoretic function on the free generating set is actually a function, in order to get a morphism from the free abelian group $F(\mathbb{Z}/m\mathbb{Z}\times \mathbb{Z}/n\mathbb{Z})$ to $\mathbb{Z}/\gcd(m,n)\mathbb{Z}$.  
Since you have a free abelian group, this guarantees that by extending linearly you get a morphism. So
$$g\left(\sum_{i=1}^k r_i(a_i,b_i)\right) = \left(\sum_{i=1}^k r_ia_ib_i\right)\bmod \gcd(m,n)$$
gives a morphism from the free abelian group on $\mathbb{Z}/m\mathbb{Z}\times \mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}/\gcd(m,n)\mathbb{Z}$.
Then to verify that $g$ factors through the tensor product, we must verify that
$$\begin{align*}
g\Bigl( (a+a',b) - (a,b) - (a',b)\Bigr) &= 0\bmod \gcd(m,n)\\
g\Bigl( (a,b+b') - (a,b) - (a,b')\Bigr) &= 0\bmod \gcd(m,n)\\
g\Bigl( (ka,b) - k(a,b)\Bigr) &= 0\bmod \gcd(m,n)\\
g\Bigl( (a,kb) - k(a,b)\Bigr) &= 0\bmod \gcd(m,n).
\end{align*}$$
If this holds, then the map $g$ factors through the tensor product, yielding a morphism $f$ with $f(a\otimes b) = g(a,b) = ab\bmod \gcd(m,n)$. 
