Given: $X=\{0,1,2,...,m-1\}$, $f:X\to X$, $f(x)=nx \pmod m$. Find conditions on $m$ and $n$ that ensure that $f$ is a bijection.
Progress
It seems that $(m,n)=1$ but I can't prove that. I tried to show that otherwise f is not injective. I assumed that $(m,n)=r>1$ and $m=rm_0$ , $n=rn_0$ . I wanted to show that $f(x_1)=f(x_2)\nRightarrow x_1=x_2$. So I got something like $nx_1=nx_2+mk \implies r(x_1-x_2)n_0=rkm_0$ for some $k\in \mathbb{N}$. But it seems from last equation like it is the same for $r=1$.
Hint: $X$ is a finite set, so $f: X\to X$ is bijective if and only if it is either one-to-one or onto. (If it's one, then it's the other.) So you have your choice--you can work with either condition.
How about this: if $f$ is onto, then there exists some $x \in X$ such that $f(x) = 1$. That is, $nx = 1 (\textrm{mod } m)$, or in other words, $n$ is invertible mod $m$. Conversely, suppose $n$ is invertible mod $m$, so $nx = 1$ for some $x$. Then $f$ is onto: given $y\in X$, take $f(xy) = nxy = 1y = y$.
So, do you know (or can you show) that $n$ is invertible mod $m$ if and only if $gcd(m,n) = 1$? See also http://en.wikipedia.org/wiki/Modular_multiplicative_inverse