TITLE: GCD in arbitrary domain
QUESTION [13 upvotes]: Is there a domain where computing GCD of two elements is not trivial (i.e. Euclid's algorithm will not work)? AFAIK we can always use the Euclid's algorithm in a Euclidean Domain.

REPLY [3 votes]: Some dictionary definitions might be helpful.

A number $a$ in a ring $R$ is said to be an associate of a number $n \in R$ if there is a unit $u \in R$ such that $a = un$.

For example, in $\mathbb Z[i]$, $-7i$ is an associate of 7 since $-7i = (-i) \times 7$. Okay, this might not seem too relevant just yet.

A ring $R$ is said to be a unique factorization domain if every nonzero number $n$ has a factorization into units and prime factors, and the combination of prime factors is distinct and unique to $n$ and its associates (ordering is irrelevant if multiplication is commutative).

A unique factorization domain might also be a Euclidean domain, or it might not be. For now I'll skip over the concept of principal ideal domains.

A ring $R$ is said to be a Euclidean domain if there exists at least one function $f$, satisfying the requirements for use in the Euclidean algorithm, such that for any pair of nonzero numbers, the Euclidean algorithm using $f$ can be completed to a result.

These are the requirements for a function $f$ to be used in the Euclidean algorithm:

$f(n) = 0$ if and only if $n = 0$, otherwise $f(n) > 0$ and $f(n) \in \mathbb Z$.
If $d$ is a non-associate divisor of non-unit $n$, then $f(d) < f(n)$ (I think it's required that if $a$ is an associate of $n$ then $f(n) = f(a)$).

In good ol' $\mathbb Z$, the usual choice is the absolute value function. It is the best choice, in my opinion. But there are many other functions that will do just fine, at least in theory if not practicality, like $f(n) = 1729n^4$.
In many domains of algebraic integers, like imaginary quadratic integer rings, the norm function is a frequent choice, leading to this definition:

An Euclidean domain $R$ is said to be a norm-Euclidean domain if the domain is Euclidean for the norm function (or the absolute value of the norm function, if the norm function in $R$ can give negative values).

So here are some examples of domains that fall at different places in the Venn diagram drawn from the preceding definitions:

Norm-Euclidean and unique factorization domain: $\mathbb Z[\sqrt 2]$, since this domain is Euclidean for the absolute value of the norm function.
Euclidean and unique factorization domain, but not norm-Euclidean: $\mathcal O_{\mathbb Q(\sqrt{69})}$, since this domain is not Euclidean for the absolute value of the norm function, e.g. $$\gcd\left(\frac{23}{2} + \frac{3 \sqrt{73}}{2}, 18 + 2 \sqrt{73}\right),$$ but it is Euclidean for a specially adjusted norm function. As a matter of practicality, it is best to just do GCD by prime factorization in this domain.
Unique factorization domain but not Euclidean: $\mathcal O_{\mathbb Q(\sqrt{-19})}$, which I mention in antoher answer.
Neither Euclidean nor unique factorization domain: $\mathbb Z[\sqrt{10}]$, try to resolve $\gcd(2, \sqrt{10})$ by the Euclidean algorithm with whatever suitable function you can think of. If you find one that works for that pair, let me know in the comments. Of course it won't work for some other pair.