For a ring $A$, an ideal $I\subset A$ and an $A$-module $M$, let $\hat{M}$ denote the $I$-adic completion of $M$.
I'm trying to prove that $M/I^nM\simeq\hat{M}/\hat{I}^n\hat{M}$.
The map $f:M/I^nM\to\hat{M}/\hat{I}^n\hat{M}$ is given by $[m]\mapsto[(m,m,...)]$, which I've checked to be well-defined.
I've found in many places that the inverse map $f^{-1}$ is a "naturally" defined map, but it's definitely not natural for me yet.
I've realized that if $(x_i)_{i\geq 1}\in\hat{M}$, then for $m\geq 1$ large enough, we get $[(x_i)_{i\geq 1}]=[(x_1,...,x_m,x_m,...)]$ in $\hat{M}/(\hat{I})^n\hat{M}$, so I've tried to define $f^{-1}([(x_i)_{i\geq 1}]):=[x_m]$, and I've checked that $f^{-1}\circ f=id$, but couldn't prove that $f\circ f^{-1}=id$, because by applying $f^{-1}$ we lose the information about the first terms in the sequence.
Then how should I define $f^{-1}$?
I think you're confusing yourself because you're representing elements of quotients of $M$ by elements of $M$ and forgetting that there's an equivalence relation on them. In particular, if $(x_1,x_2,\dots)$ is an element of $\hat{M}$ where each $x_i$ is an element of $M$, there is an equivalence relation on such sequences since we only actually care about the image of $x_i$ in $M/I^iM$ (that is, an element of $\hat{M}$ should really be a sequence where the $i$th term is an element of $M/I^iM$). In particular, this means that $$(x_1,x_2,\dots,x_m,x_{m+1},\dots)$$ is the exact same element of $\hat{M}$ as $$(x_m,x_m,\dots,x_m,x_{m+1},\dots).$$ The compatibility conditions required for the first sequence to be an element of $\hat{M}$ to begin with say that the image of $x_m$ in $M/I^iM$ for $i\leq m$ must be equal to the image of $x_i$, so that these two sequences are the same when we think of the $i$th term as being in $M/I^iM$ rather than in $M$. This is exactly what you need for $f\circ f^{-1}$ to be the identity.