If a finite group $G$ of order $n$ has at most one subgroup of each order $d\mid n$, then $G$ is cyclic
I'm reading the proof of a theorem in Fundamentals of Group Theory An Advanced Approach by Steven Roman.
(Characterization by subgroups) If a finite group $G$ of order $n$ has the property that it has at most one subgroup of each order $d\mid n,$ then $G$ is cyclic (and therefore has exactly one subgroup of each order $d\mid n$ ).
Here $o(a)$ is the order of $a$ and $\phi(d)$ is the number of elements of order $d$.
Because the order of a subgroup must be a divisor of that of a group, I get $$n=\sum_{d \in D} \phi(d) = \sum_{d \mid n} \phi(d)$$ Then I'm stuck at getting how $\phi(n) > 0$.
Could you please elaborate on this point?
I am confused by your question, so I apologize if my answer misses the point.
The proof you quote is using Lagrange's theorem in the "$\leq$" step, that is, that the order of an element ($d$) has to divide the order of the group ($n$), and so without loss of generality you can restrict the sum only to those $d$ that divide $n$.
Then it uses the divisor sum property of Euler's totient function.
En passant, this also proves that there is exactly one subgroup of order $d$ (opposed to the "at most one" of the hypothesis), because otherwise you'd get $n<n$ which is a contradiction.