TITLE: An exercise in Liu regarding a sheaf of ideals (Chapter II 3.4)
QUESTION [5 upvotes]: I'm fairly certain there is both a typo and an omission in this exercise. It reads
"Let $X$ be a scheme and $f \in \mathcal{O}_X(X)$. Show that $U \mapsto f|_U \mathcal{O}_X(U)$ for every affine open subset $U$ defines a sheaf of ideals on $X$. We denote this sheaf of ideals by $f \mathcal{O}_X$..."
Surely "affine" above should be omitted, but my real question is 

are we missing any hypotheses on $f$?

It is clear that $f \mathcal{O}_X$ defines a presheaf satisfying the uniqueness condition, i.e., if an global section restricts to zero everywhere on an open over, then the element is identically $0$, as $\mathcal{O}_X$ is a sheaf to begin with. However, in proving that is satisfies the criterion regarding the glueing of local sections,

do we not need the hypothesis that $f|_U$ is not a zero-divisor for
  all $U$?

This is the only condition in which I'm able to get at the result. Am I missing anything?
EDIT: Please see Martin Brandenburg's answer. I was mistaken. (But it was not a regrettable mistake, as the point which I missed deserves an extra line or two of qualification.)

REPLY [2 votes]: An example showing that "affine" should not be omitted. 
Let $X$ be the union of an affine line $\Gamma_1$ and a projective line $\Gamma_2$ meeting at two points.  Suppose the ground field $k$ has characteristic different from $2$. Let $t$ be the parameter of $\Gamma_1$ such that the intersection points are $t=1$ and $t=-1$. One can check that: 

$O_X(X)=k+(t^2-1)k[t]$; 
Let $f=t^2-1$. Then $(fO_X)(X)=(t^2-1)k[t]\supsetneq f.O_X(X)$.