You don't need to prove anything, this follows from the definitions: If is an element of order in a group and is a positive integer, then and . So if n and m are relatively prime then .

To see why that definition holds, let d=gcd(n,m), clearly , so that | . Also if is a positive integer less than n/d. then by definition of |a|. And since d=gcd(n,m) you get .