Okay here is the question and ill give the answer i put i dont know if its sufficient or if there was another way.

Given G is a finite group whose only subgroups are {e} and G itself

A)Show G is cyclic

2 choices for G either G = {e} and G is cyclic. If not then there are more elements in G and since the only subgroups are the ones mentioned these elements must generate the entire group or else there would be another subgroup so there is a generator and G is cyclic.

B)Show G is of prime order

G is cyclic so G is isomorphic to Zn then we know G has subgroups generated by elements that divide order of G. There are only those 2 so order G is only divisible by 1 and itself so n is prime