Suppose $R = \mathbb{Q}[x_1, ..., x_n]/I$, and $J \subset R$ is a given height one ideal. Is there a quick algorithm one could write to determine if $J$ is a principal ideal or necessarily not principal? Is it not possible to do this with Groebner bases?

In the graded situation the concept of "minimal generators" is welldefined. Just think about the minimal generators as part of the minimal free resolution. Their number is the first total Betti number and those can be computed with Gröbner bases. Macaulay2 has the command mingens which does it directly. I don't know how to do it in the nongraded situation since I think the concept of minimal generators of an ideal is not really welldefined. Maybe principal vs. nonprincipal can be decided, though. 


Locally principalAt least in height1 ideal case, in a normal domain (or at least G1+S2 domain), the following should let you know whether the ideal is locally principal. Let $J$ be the ideal in question and let $J_2$ be another ideal isomorphic to $Hom_R(J, R)$ (which you can do in a number of ways, say by forming a colon or by embedding the module back into R). Then $J\cdot J_2$ is an ideal. If $J$ is locally principal, it corresponds to a Cartier divisor $D$. Then $J_2$ corresponds to $D$. It's a fact (first pointed out to me by Tommaso de Fernex) that $D$ is Cartier if and only if $$O(D) \cdot O(D) = J\cdot J_2 = \langle g \rangle$$ is principal. That doesn't help...But you say, this doesn't help us at all. All I've done is give you another ideal we need to check whether or not it is principal! The point however, is that we know that the reflexification of $I\cdot J$ is principal! (Recall reflexification just means applying $Hom(\bullet, R)$ twice, Macaulay2 can do this for instance). Also remember that locally principal ideals are always reflexive. On the other hand $J \cdot J_2$ agrees in codimension 1 with its reflexification (since reflexification won't change anything in codimension 1 for a normal domain). It follows that $J \cdot J_2$ is principal if and only if $J\cdot J_2$ is reflexive. Proposition: Hence $J$ is locally principal if and only if $J \cdot J_2$ is reflexive. Perhaps its worth noting that you can also use this to identify the locus where $J$ is not locally principal. If $L$ is the reflexification of $J \cdot J_2$, then compute the $$\text{Ann}_R(L/(J \cdot J_2)).$$ That is just the locus where $J$ is not locally principal. 

