$\DeclareMathOperator{Spec}{Spec}\DeclareMathOperator{support}{support}$ Let $R$ be a commutative ring with unity. Let $a, b \in R$. If $(a) = (b)$, then we wish to show that there is some unit $u \in R^\times$ such that $a = ub$.
Let us use the geometric viewpoint for intuition. Let $R$ be the ring of smooth functions on a compact smooth manifold $M$. Thus, $a, b \in R$ are smooth functions on $M$.
$(a) = (b)$ implies the support of $a$ equals the support of $b$.
For a proof, since $a \in (a) = (b)$, we have $a \in (b)$, ie, there is a function $f \in R$ such that $a = fb$. Thus, $a(p) \neq 0 \implies f(p)b(p) \neq 0 \implies b(p) \neq 0$. Thus, $\support(a) \subseteq \support(b)$. By symmetry, we get $\support(b) \subseteq \support(a)$. In total, we have $\support(a) = \support(b)$. This allows us to create a function $u$:
$$ u(p) \equiv \begin{cases} b(p)/a(p) & a(p) \neq 0 \\ 0 & a(p) = 0 \end{cases} $$
We see that $b = ua$. If $u$ is supported everywhere on $M$ (ie, $support(u) = M$), then $u$ is a unit in $R$ such that $(a) = (b)$. $\blacksquare$
I wish to translate the above geometric intuition into algebraic geometry. I believe I should be able to treat $a$ and $b$ as functions on $\Spec(R)$, and repeat the argument as above. Here's my attempt:
Since $(a) = (b)$, this implies that $a = fb$ for some element $f \in R$. Consider a point (prime ideal) $\mathfrak p \subseteq R$. Since $a \equiv_{\mathfrak p} fb$, if $a \not \equiv_{\mathfrak p} 0$, this means $fb \not \equiv_{\mathfrak p} 0$, or that $f \not \equiv _{\mathfrak p} 0$ and $b \not \equiv_{\mathfrak p} 0$. But how do we proceed further?
- To create $u_{\mathfrak p} \equiv_{\mathfrak p} b/a$, we need some way to invert the $a \in R/\mathfrak p$. How do we do this?
- Even if we succeed in creating all the $u(\mathfrak p)$, how do we glue the solutions together to get an element $u \in R$?
I feel knowing how to translate the geometric argument above into algebraic geometry will really help me see the power of (affine) schemees.