There are $\dfrac{m}{\gcd(m,x)}$ distinct elements in the set $\{ax \pmod{m}:a\in\{0,...,m-1\}\}$
I have only known these by using a computer to generate the number of distinct elements. But I am not sure how to prove this conjecture.
And is there any way that we can connect this problem to Euler's phi function so that we can simply use properties of $\phi$ function to prove it?
And can we also use some counting principle here to give an exact answer?