My attempt. $f$ is an eigenform with integer coefficients $\in S_2(\Gamma_0(N))$, otherwise it is usually not true that its periods form a lattice in $\Bbb{C}$. As $f=\sum_{d|N} c_d \tilde{f}(dz)$ for some newform of lower level, we can restrict to the case that $f$ is a newform. Following [Cremona](http://homepages.warwick.ac.uk/staff/J.E.Cremona/book/fulltext/chapter2.pdf), for $\alpha\in\Bbb{Q}$ and $p\equiv 1\bmod N$, $$(1+p-a_p(f))\int_\alpha^{i\infty} f(z)dz=\int_\alpha^{i\infty} (1+p-T_p) f(z)dz$$ $$=\int_\alpha^{p\alpha} f(z)dz+\sum_{k=0}^{p-1} \int_\alpha^{(\alpha+k)/p} f(z)dz\tag{1}$$ The $p\alpha$ and $(\alpha+k)/p$ are $\Gamma_0(N)$ equivalent to $\alpha$, whence the RHS is equal to a sum of integrals over **closed-loops** in $X_0(N)$. If you prove that $p+1-a_p(f)\ne 0$ for some $p\equiv 1\bmod N$ then you get that the subgroup of $\Bbb{C}$ generated by the $\int_\alpha^\beta f(z),\alpha,\beta\in \Bbb{Q}\cup i\infty$ is a lattice iff $\{\int_\gamma f(z),\gamma$ closed-loop in $X_0(N)\}$ is a lattice. The theorem we need is that with $g=\dim_\Bbb{C} S_2(\Gamma_0(N))$ then $ \pi_1(X_0(N))^{ab}\cong \Bbb{Z}^{2g}$. $S_2(\Gamma_0(N))$ has a $\Bbb{C}$-basis $f_1,\ldots,f_g$ of modular forms with integer coefficients. We choose it such that $f_1=f$. If $h\in S_2(\Gamma_0(N))$ is such that both $\Re(h(z)dz),\Re(i h(z)dz)$ integrate to $0$ on every closed-loops then $h$ has an holomorphic primitive on $X_0(N)$, which must be constant, so $h=0$. This proves that with $\gamma_1,\ldots,\gamma_{2g}$ a $\Bbb{Z}$-basis of $\pi_1(X_0(N))^{ab}$, the $\lambda_l=(\int_{\gamma_l} f_1(z)dz,\ldots,\int_{\gamma_l} f_g(z)dz)$ are $\Bbb{R}$-linearly independent, whence they generate a lattice $\Lambda$ in $\Bbb{C}^g$. Let $\Bbb{T}$ be the $\Bbb{Z}$-algebra generated by the Hecke operators. Take an element $P\in \Bbb{T}$ such that $Pf_j=0$ except for $Pf_1\ne 0$. Since $f_1$ is a newform then $Pf_1=c f_1$. Each $\int_\gamma Pf_j(z)dz$ is given by integrating $f_j$ on some curves from cusps to cusps, with the second equality of $(1)$ you get that for all closed-loop $\gamma$ in $X_0(N)$, $$(\int_\gamma (1+p-T_p)Pf_1(z)dz,\ldots,\int_\gamma (1+p-T_p)Pf_g(z)dz) \in \frac1{d} \Lambda$$ for some integer $d$ independent of $\gamma$. > This proves that for any $\lambda\in \Lambda$, $((1+p-a_p(f))c\lambda_1,0\ldots,0) \in \frac1d \Lambda$, and hence $\{ \int_\gamma f_1(z)dz, \gamma \in \pi_1(X_0(N))\}$ is a lattice in $\Bbb{C}$, from which the $\int_\alpha^\beta f_1(z)dz,\alpha,\beta\in \Bbb{Q}\cup i\infty$ generate a lattice in $\Bbb{C}$.