The definition of effective Cartier divisor that I'm using is: a closed immersion whose corresponding quasicoherent sheaf of ideals is an invertible sheaf.
Let $X$ be a scheme that is dimension 1 and locally of finite type over a field $k$ (but can be singular or have multiple components). Let $p$ be a closed point on $X$. Then why is the canonical morphism $f : Spec(k(p)) \rightarrow X$ is an effective Cartier divisor?
This is my attempt so far:
Since $p$ is a closed point, $f : Spec(k(p)) \rightarrow X$ is a homeomorphism onto its range and the range is closed. Also, the pullback morphism $f^\# : O_X \rightarrow f_* O_{Spec(k(x))}$ is surjective (as on an affine open neighbourhood $U = Spec(A)$ of $p$, we have $A \rightarrow Quot(A/p) = A/p$ since $p$ is a closed point so it's a maximal ideal, so pullback is surjective). Therefore it's a closed immersion.
Let $\mathcal{I}$ be the corresponding quasicoherent sheaf of ideals. For open sets U that don't contain $p$, $\mathcal{I} \sim O_X|_{U}$ so is an invertible sheaf on there. But now I'm stuck on the part where open sets $U$ that contain $p$.
Is the statement even true? If so, how do I prove $\mathcal{I}$ is invertible on some open set $U$ that contains $p$?