Let $X$ be a scheme, and let $\mathcal{K}$ be the sheaf of total quotient rings of $X$.
Is the data of a Cartier divisor on $X$ equivalent to the data of an invertible subsheaf of $\mathcal{K}$ for all schemes $X$ or do we need additional assumptions?
In more detail:
In most (if not all) textbooks, a Cartier divisor is defined to be a global section of the sheaf $\mathcal{K}^*/O^*$. Explicitly, it is given by the following data: an open cover $\{U_i\}$ of the scheme $X$, and for each $i$, an $f_i \in \Gamma(U_i, \mathcal{K}^*)$, such that for each $i, j$, $f_i/f_j \in \Gamma(U_i \cap U_j, O^*)$. Two such data $\{(U_i, f_i)\}$, $\{(V_j, g_j)\}$ define the same Cartier divisor if there is a common refinement $\{W_k\}$ such that $\displaystyle\frac{(f_i)|_{W_k}}{(g_j)|_{W_k}} \in \Gamma(W_k, O^*)$. Given a Cartier divisor $D$, one may construct an invertible sheaf $L(D)$ which is a subsheaf of $\mathcal{K}$ locally generated by $\displaystyle\frac{1}{f_i}$ on $U_i$.
All of this is stated in most textbooks, but the converse is usually not. It seems to me that this process can be reversed, i.e. given an invertible subsheaf $L \subseteq \mathcal{K}_X$, we choose an open cover $\{U_i\}$ of $X$ such that $L|_{U_i}$ is trivial, which allows us to choose a trivializing section $g_i \in \Gamma(U_i, L) \subseteq \Gamma(U_i, \mathcal{K})$. I believe the fact that $g_i$ generates $L|_{U_i} \cong O_{U_i}$ implies that $g_i$ is not a “zero-divisor”, therefore $g_i \in \Gamma(U_i, \mathcal{K}^*)$. The intuition is that $\mathcal{K}^*$ models the total quotient ring in which an element is either a zero-divisor or a unit.
But I am hesitant because I did not add any additional assumption on the scheme $X$ (e.g. integral, locally noetherian, etc) and after seeing a paper on misconceptions about $\mathcal{K}_X$, I feel less confident about my reasoning.
In any case, if the above reasoning stands, we have $g_i \in \Gamma(U_i, \mathcal{K}^*)$, so we obtained a Cartier divisor $\{(U_i, g_i^{-1})\}$ (the condition $g_i/g_j \in \Gamma(U_i \cap U_j, O^*)$ is easy). The above constructions seem to be inverses of each other.
That explains the title of the question: is a Cartier divisor the same thing as an invertible subsheaf of $\mathcal{K}_X$ on any scheme $X$? I hope someone can either confirm it or deny it.
Along this line of thought, it is usually stated (e.g. Hartshorne Corollary 6.14) that on any scheme $X$, the map $\text{CaCl} X \to \text{Pic} X$ from the Cartier divisor class group to the Picard group is injective, but not surjective in general.
I am wondering if the reason why it is not surjective is that one can’t always embed an invertible sheaf $L$ in $\mathcal{K}_X$?
When $X$ is integral, as in Hartshorne Proposition 6.15, $\mathcal{K}_X$ is the constant sheaf of the function field of $X$ and $L \otimes \mathcal{K}_X \cong \mathcal{K}_X$, so $L \hookrightarrow L \otimes \mathcal{K}_X \cong \mathcal{K}_X$ can be realized as a subsheaf of $\mathcal{K}_X$.
Further remarks
Regarding when an invertible sheaf $L$ is associated to a Cartier divisor $D$, I also find the following discussion useful
It seems to me that given an invertible sheaf $L$ on a scheme $X$, the following are equivalent:
(a) there exists a Cartier divisor $D$ such that $L \cong \mathcal O(D)$;
(b) $L$ admits an invertible rational section $s$ (appropriately defined);
(c) $L \otimes_{\mathcal O_X} \mathcal K_X \cong \mathcal K_X$.
(a) $\Rightarrow$ (b): assume wlog $L = \mathcal O(D) \subseteq \mathcal K$, then $1$ is an invertible rational section.
(b) $\Rightarrow$ (a): take $D= \text{div} (s)$.
(c) $\Rightarrow$ (a): for any invertible sheaf $L$, we have an injection $L \hookrightarrow L \otimes_{\mathcal O_X} \mathcal K_X$ because $L$ is locally free of rank $1$. If $L \otimes_{\mathcal O_X} \mathcal K_X \cong \mathcal K_X$, then we get an embedding $L \hookrightarrow \mathcal K_X$, therefore $L$ is isomorphic to an invertible subsheaf of $\mathcal K_X$, which, by what we have settled, is $\mathcal O(D)$ for some Cartier divisor $D$.
(a) $\Rightarrow$ (c): assume $L$ is an invertible subsheaf of $\mathcal K_X$, then the natural map $L \otimes_{\mathcal O_X} \mathcal K_X \to \mathcal K_X$ is an isomorphism.