In his book *Algebraic Geometry and Arithmetic Curves* Qing Liu claims in Exercise 3.4, page 56, the following for a scheme $X$ and a global function $f\in \mathcal O\_X(X)$:  

"The map $U\mapsto f\vert \_U\mathcal O\_X(U)$ for every affine open subset $U$ defines a sheaf of ideals on $X$."  

The presheaf thus defined (on the base of open sets given by affines) is certainly separated but I don't see why it should be a sheaf if $X$ is not integral.  

The problem is that already if you have two open affines $U,V$ and functions $s\in \mathcal O(U),t\in \mathcal O(V)$ such that $fs=ft$ in $U\cap V$ there is no reason that $s$ and $t$ coincide on $U\cap V$, so that $s$ and $t$ can't *a priori* be glued and I don't see why the function on $U\cup V$ obtained by gluing $fs$ and $ft$ (they *can* be glued since $\mathcal O\_X$ *is* a sheaf!) could be written as a product $(f\vert\_{U\cup V})w$ for some $w\in \mathcal O(U\cup V)$.  

Hence my question: Am I missing something or is the statement in the exercise false without some hypothesis on the scheme $X$?



On the definition of a principal ideal sheaf
Note that we only need consider the case (of your setup) where $U \cup V$ is affine. If the function obtained by gluing $fs$ and $ft$ is not a multiple of $f$, then it is a nonzero element in $ \mathcal O (U \cup V) /f$, hence a nonzero function on $\operatorname{Spec} ( \mathcal O (U \cup V)/f)$. But $\operatorname{Spec} ( \mathcal O (U \cup V)/f)$ is covered by $\operatorname{Spec} ( \mathcal O (U)/f)$ and $\operatorname{Spec} ( \mathcal O (V)/f)$ so the function must be nonzero on one of those, contradiction.


The general principle here is that kernels of maps of sheaves can be computed one open set at a time.


But probably the simplest proof is to reduce to distinguished affine opens and do it algebraically. Suppose we have an affine open $\operatorname{Spec} R$ covered by open sets $\operatorname{Spec} R [1/a\_i]$ where $a\_i$ generate the unit ideal. If a global section $x$ of the structure sheaf restricts to a multiple of $f$ on each open, then for all $i$ we have $$ a\_i^{e\_i} (x - f s\_i) =0$$ for some $e\_i$ and $s\_i$.


Because the $a\_i$ generate the unit ideal, we have $\sum\_{i=1}^n a\_ib\_i=1$, so $$x = \left(\sum\_{i=1}^n a\_ib\_i\right)^{1-n + \sum\_{i=1}^n e\_i } x$$ and when we expand out the multionmial we can write each term as a multiple of $f$ using the appropriate identity, so $x$ is a multiple of $f$.


