9 and 10 have no common factors. so if m/10 is an integer and m/9 is an integer then m/90 is an integer and m=90k for some k. 5 divides 90 so m/5 is an integer.
In fact, 5 divides 10 so "m/10 is an integer" is enough to say that "m/5 is an integer". "m/9 is an integer" is unnecessary.
(An this problem has nothing to do with "prime numbers".)