Group with more than one element and with no proper, nontrivial sub groups must have prime order.

Resuming all the above, together with my comment and, of course, what you did:

Take any $\,1\neq g\in G\,$ (exists such an element since $\,|G|>1\,$), then $\,\langle\,g\,\rangle=G\,$ , otherwise $\,G\,$ has a non-trivial subgroup, and we already know $\,G\,$ is cyclic:

1) It can't be the order of $\,g\,$ is infinite, otherwise $\,G=\langle\,g\,\rangle\cong\Bbb Z\,$ , but then there're lots of non-trivial subgroups: $\,\langle\,g^n\,\rangle\cong n\Bbb Z\,\lneq\Bbb Z\cong G\,$ , and thus $\,G\,$ is cyclic and finite.

2) Supose finally that $\,|G|=ord(g)=n\,$ . If there exists $\,k\in\Bbb N\,\,,\,1<k<n\,$ , s.t. $\,n=mk\,\,,\,m\in\Bbb N\,$ , then the order of $\,g^k\in G\,$ is more than $\,1\,$ * and at most* $\,m\,$ , since

$$\left(g^k\right)^m=g^{mk}=g^n=1$$

and

$$1<k<n\Longrightarrow 1\lneq\langle\,g^k\,\rangle \lneq\langle\,g\,\rangle=G$$

And we have a nontrivial subgroup. Thus, no such $\,k\,$ can exist and this means $\,n\,$ is a prime number. $\;\;\;\;\;\;\;\;\square\,$


You can say $G=\langle a, b\rangle$ and $G=\langle a\rangle$, there is no contradiction because the second equality implies that $b\in \langle a\rangle$ and $\langle a, b\rangle=\langle a \rangle$.