The following is part of an exercise from Lenstra's Galois theory for schemes..
Let $a=\frac{b}{c}\in \mathbf{Q}^\times$, $n\in \widehat{\mathbf{Z}}^\times$.
Prove that there exists a sequence of positive integers $(n_i)_{i\geq 0}$ that satisfies $\operatorname{gcd}(n_i,2bc)=1$ for all $i$ and such that $n=\lim_{i\to\infty} n_i$ in $\widehat{\mathbf{Z}}$.
First of all, I have trouble understanding convergence of sequences in $\widehat{\mathbf{Z}}$. A similar exercise on convergence is treated here and here, but I don't seem to understand this.
Of course, taking the definition of convergence using the topology would give: $(a_n)$ converges (to $0$ for example) if and only if for every open set $U\ni 0$, $\exists N$ such that $n\geq N$ implies $a_n\in U$. We can know use that an open neighbourhood is given by finite intersections of $Ker \pi_k$ and so on, but this seems so complicated..
A claim in solutions I found on the internet says the following: a sequence $(a_k)$ converges in $\widehat{\mathbf{Z}}$ if and only if for all $n$, the sequence of reductions $(\pi_n(a_k))_{k\geq 1}$ in $\mathbf{Z}/n\mathbf{Z}$. I don't see why this claim is true. (One direction is trivial, since the projections are continuous.)
Could someone give and explain thoroughly how we should attack proving convergence of sequences in $\widehat{\mathbf{Z}}$ and give a hint for this exercise? I think we should use density of $\mathbf{Z}$ in $\widehat{\mathbf{Z}}$, but then I don't see how to incorporate the other conditions?