In the p.163 of Hartshorne's AG, the inverse image ideal sheaf $\mathscr{I}'=f^{-1}\mathscr{I}\cdot\mathscr{O}_X$ is defined to be the ideal sheaf in $\mathscr{O}_X$ generated by the image of $f^{-1}\mathscr{I}$, under the morphism $f^{-1}\mathscr{O}_Y\rightarrow\mathscr{O}_X$. This definition is not clear enough for me. So I want to pose a question on it to make it more explicit.
I don't understand what it means by the phrase "generated by the image of ...". Does it mean that $\mathscr{I}'$ is generated by all the global sections in the image sheaf of $f^{-1}\mathscr{I}$? Or otherwise, can I define it to be the associated sheaf of presheaf $U\mapsto (f^{-1}\mathscr{I})(U)\mathscr{O}_X(U)$? (Here I denote $(f^{-1}\mathscr{I})(U)$ to be its image in $\mathscr{O}_X(U)$.) Which should be the standard characterization of $\mathscr{I}'$? Or, are they equivalent?
The image of $f^{-1}\mathscr{I}$ under the morphism $f^{-1}\mathcal{O}_Y\to\mathcal{O}_X$ is a subsheaf of abelian groups of $\mathcal{O}_X$, but not usually a sub-$\mathcal{O}_X$-module. In order to rectify this, we need to take the $\mathcal{O}_X$-module generated by $f^{-1}\mathscr{I}$.
Your guess of taking the sheaf associated to the presheaf $U\mapsto (f^{-1}\mathscr{I})(U)\cdot \mathcal{O}_X(U)$ is the correct definition. The version using global sections is not correct in the general case, and here is an example: let $f$ be the identity map on $\Bbb P^1$ and let $\mathscr{I}=\mathcal{O}(-1)$. This is the sheaf of ideals of a point, and it has no global sections, so your definition via global sections would give you the zero sheaf, not $\mathcal{O}(-1)$ like you are required to get by the fact that $f^{-1}$ is a functor.