We can multiply residu-classes, not "allways" divide them:
We can only divide classes when we're working in the group .
In your example you used n = 21, and 7|21. Observe that mod 21. But it's not true that mod 21.
You're getting into trouble when you're using elements that divide n.
The conclusion is: mod mod n iff gcd(x,n) = 1.
We can draw the following conclusion:
mod mod n.
Hence we have the following cases:
1. x is a root if: mod n.
2. if then all are roots, ie. all with gcd(x,n) = 1. And x with gcd(x,n) can be roots.
3. . Then only elements from the group that have order are roots. And x with gcd(x,n) can be roots.
4. If neither or then only x, with gcd(x,n) can be roots.
I hope you know the Euler totient function a little. For more about the euler totient function: Euler's totient function - Wikipedia, the free encyclopedia
Finding roots for all with gcd(x,n) is indeed a hard problem.