As the title says I have to show that $\hat{\mathbb{Z}}/m\hat{\mathbb{Z}} \cong \mathbb{Z}/m\mathbb{Z}$. I know this question has been asked before at: How to show $\hat{\mathbb{Z}}/n\hat{\mathbb{Z}}\cong \mathbb{Z}/n\mathbb{Z}$. But I'm having trouble with showing that $ker(\phi) \subseteq m\hat{\mathbb{Z}}$ in particular. Here $\phi$ is defined as the projection from $\hat{\mathbb{Z}}$ to the $m$th coordinate. I've already proven that $\phi$ is surjective and that $m\hat{\mathbb{Z}} \subseteq ker(\phi)$. So if I prove that $ker(\phi) \subseteq m\hat{\mathbb{Z}}$ then I will have shown by the isomorphism theorem that $\hat{\mathbb{Z}}/m\hat{\mathbb{Z}} \cong \mathbb{Z}/m\mathbb{Z}$.
Note that I don't know what inverse limits are or what topoligical groups are. In the exercise the profinite completion of $\mathbb{Z}$ is just defined as the subring $\{(a_0,a_1,...)\in \prod_{n\geq 1}\mathbb{Z}/n\mathbb{Z}: \text{ for all }n\in \mathbb{N} \text{ and } d|n, a_n = a_d \text{ mod } d\}$.
So given an $(a_0,a_1,...)\in ker(\phi)$ I want to show that there is a $(b_0,b_1,...)\in \hat{\mathbb{Z}}$ such that $(a_0,a_1,...) = m(b_0,b_1,...)$.
I was able to show that for an $(a_0,a_1,...)\in ker(\phi)$ there is a $(b_0,b_1,...)\in \prod_{n\geq 1}\mathbb{Z}/n\mathbb{Z}$ with $m(b_0,b_1,...) = (a_0,a_1,...)$. But this element was not unique nor was it always in $\hat{\mathbb{Z}}$. I do see that for an $n\in \mathbb{N}$ with $gcd(n,m) = 1$ the $b_n$ is uniquely defined and I was also able to show that this element does satisfy for all $d|n, a_n = a_d \text{ mod } d$. That is to say that because $gcd(n,m) = 1$ we know that there is a unique $m^{-1}\in \mathbb{Z}/n\mathbb{Z}$. And so we must choose $b_n = m^{-1}a_n \text{ mod } n$. Now say $d|n$ then $gcd(d,m) = 1$ and so $b_d = m^{-1}a_d \text{ mod } d$. Note that if $mm^{-1} = 1 \text{ mod } n$ then also $mm^{-1} = 1\text{ mod } d$. By definition we also have that $a_n = a_d \text{ mod } d$. And so $b_n = m^{-1}a_n = m^{-1}a_d = b_d \text{ mod } d$.
But if $gcd(n,m) = r > 1$ then I don't know what to do. I know that $a_n = a_r \text{ mod } r$ and $a_r = a_m = 0 \text{ mod } r$. And so $a_n = xr \text{ mod } n$ for some $x\in \mathbb{Z}/n\mathbb{Z}$. Then you could find integers $a,b$ such that $an+bm = r$ and so $a_n = xbm \text{ mod } n$. But taking $b_n = xb \text{ mod }n$ doesn't generally give an element in $\hat{\mathbb{Z}}$.
I've worked out an example to try and find a pattern. It sort of looks like the $(b_0,b_1,...)$ is uniquely defined, not that this is necessary of course. It looks like the restriction that $a_n = xr \text{ mod } n$ and that $a_k = a_n \text{ mod } n$ for some factor $k$ of $n$ are enough to determine $a_n \text{ mod } n$. But I stuck trying to do this.
A hint or a new approach to prove this would be appreciated.