$\mathcal{O}_X(D)$ is invertible implies $D$ is locally principal With words added for context, 14.2.G of Ravil Vakil's notes asks
Suppose $X$ is an integral, normal and Noetherian scheme, and $D$ a Weil divisor. Let $\mathcal{O}_X(D)$ be the quasicoherent sheaf defined by 
\begin{align*}
\Gamma(U,\mathcal{O}_X(D)) :=\{t\in K(X)^{\times}: {\rm div}|_U t + D|_U\geq 0\}\cup \{0\}\}.
\end{align*} 
Suppose in addition that $\mathcal{O}_X(D)$ is invertible. 
(a) Let $s$ be the rational section of $\mathcal{O}_X(D)$ corresponding to the function $1\in K(X)$ in the defintion above. Show that ${\rm div}(s)=D$.
(To clarify what $s$ is, we can see that 1 is a section of $\mathcal{O}_X(D)$ away from the support of $D$. If referring to it as "1" is confusing, Vakil uses the notation $\sigma(1)$, where $\sigma$ takes $f\in K(X)$ and outputs a rational section. More generally, if $f\in K(X)$, then $\sigma(f)$ is a section of $\mathcal{O}_X(D)$ away from the poles of $f$ and the support of $D$. We can compute the divisor of $\sigma(f)$ by taking local trivializations.)
(b) Show that $D$ is locally principal.
I think I see how (a) and (b) are equivalent, and I have tried to do (b) directly by taking an open set $U$ over which $\mathcal{O}_X(D)$ is trivial, and fixing an isomorphism $\mathcal{O}_X|_U\rightarrow \mathcal{O}_X(D)|_U$.
Then, we can let $s$ be the image of 1, and try to get a contradiction if ${\rm div}(s)|_U>-D|_U$ by finding a section that is not a multiple of $s$. For example, if given an integral, noetherian, and normal ring $A$, a height 1 prime is never contained in the union of the remaining height 1 primes, I think this approach can work. 
However, I think I am just missing something obvious. How do we prove (a) directly, as the exercise intends? (This is not homework, and I'm mainly hoping for a good way to understand why (b) is true.)
 A: I believe you are approaching the exercise in the expected way. Forget that (b) even exists. Then how would you approach (a)? To even say what $\mathrm{div}(s)$ means, you need to look at an affine open cover. Of course, two divisors are equal if on an affine open cover they induce the same divisors, and so (a) immediately (and I think necessarily) reduces to a local statement. This is precisely your attack for (b), but really it is an approach for (a) from which (b) will immediately follow.

Edit: Here is the argument. Choose $U \subset X$ an affine open subscheme such that $\mathcal{O}_X(D)$ is trivial and a trivialization $\varphi : \mathcal{O}_U \rightarrow \mathcal{O}_X(D)|_U$. Then $\mathcal{O}_X(D)|_U$ is generated (as an $\mathcal{O}_U$-module) by $\tau := \varphi(1)$. 
Now $1$ is a rational section of $\mathcal{O}_X(D)|_U$ and our trivialization sends $1$ to the rational section $\tau^{-1}$ of $\mathcal{O}_U$. Of course one has that $\mathrm{div}(\tau) + D|_U \geq 0$ and as you mention in the question, we wish to show in fact that $\mathrm{div}_{\mathcal{O}_U}(\tau) = -D|_U$. From this we will get $\mathrm{div}_{\mathcal{O}_X(D)|_U}(1) = \mathrm{div}_{\mathcal{O}_U}(\tau^{-1}) = D|_U$.
So to finish the argument, we must show that $\mathrm{div}_{\mathcal{O}_U}(\tau)+D|_U = 0$. With $\mathrm{div}_{\mathcal{O}_U}(\tau)+D|_U \geq 0$, assume to the contrary that the principal divisor $W$ of $U$ is in the support of $\mathrm{div}_{\mathcal{O}_U}(\tau)+D|_U$. Note that on the affine scheme $U$, there exists a rational section $f$ with a simple pole along $W$. Let $P_1, \dots, P_n$ be the other poles of $f$, noting that this number must be finite ($X$ is Noetherian). Then we can consider a basic affine open subscheme of $U - \cup P_i$ which meets $W$ given by $V = D(g)$ for some regular function $g$ on $U$. Now $\tau|_V$ generates the $\Gamma(V,\mathcal{O}_V)$-module $\Gamma(V,\mathcal{O}_V(D|_V))$. Since $f|_V$ has a pole along $Z|_V$, $f|_V$ is not a regular function on $V$ but $\mathrm{div}_{\mathcal{O}_V}(f|_V \cdot \tau|_V)+D|_V \geq 0$. This contradicts the fact that $\tau|_V$ generates $\mathcal{O}_V(D|_V)$, finishing the argument.

One additional question that I think is important here: why does this argument not prove that $D$ is (globally) principal? 
