A- see best answer
B-In Set S numbers which are Co-prime to 8 are 3,5,7 so inverse exist of these numbers and 1 is identity while 0,2,4,6 are not co-prime to 8 so inverse does not exist so we can form pair (1,3)(1,5)(1,7) and these pair form group under multiplication modulo