Let $V$ be a free $\mathbb{Z}$-module (or a free abelian group) with basis $(v_1$, $v_2$, $v_3)$. Denote by $x$ an arbitrary nonzero element of $V$, say $x=mv_1+nv_2+kv_3 \in V \setminus \{0\}$; here $m,n,k \in \mathbb{Z}$.
It is known that the element $x$ can be extended to a basis iff $\gcd(m,n,k)=1$. I am trying to understand this statement (which of course can be generalized for free modules of an arbitrary finite rank), but first I would like to know how does it work in practice -- given particular integers $m,n,k,$ not all zero, how do I extend the element $x$ to a basis? Further, given a candidate for a basis, how do I verify that it is indeed a basis? Could you give a particular example? If possible, I would like to see matrix interpretation of this problem -- probably this would enable me to get one step closer to this question.
The proof of the above statement (or its generalized version) would be also appreciated, albeit at the moment I am more interested in an example.