Prove that $$\operatorname {gcd}(\operatorname {gcd}(m,n), p) = \operatorname {gcd}(m,\operatorname {gcd}(n, p))$$
How to begin ?
Prove that $$\operatorname {gcd}(\operatorname {gcd}(m,n), p) = \operatorname {gcd}(m,\operatorname {gcd}(n, p))$$
How to begin ?
The simplest way to prove it is the following. Let $d_1=\operatorname {gcd}(\operatorname {gcd}(m,n), p)$ and $d_2=\operatorname {gcd}(m, \operatorname {gcd}(n,p))$. Consider $d_1$. Then we have: $d_1$ divides both $\operatorname {gcd}(m,n)$ and $p$, hence $d_1$ divides $m, n$. Further, $d_1$ divides $p$, then $d_1$ divides $\operatorname {gcd}(n, p)$. It follows that $d_1$ divides $(m, \operatorname {gcd}(n,p))$, so it divides $d_2=\operatorname {gcd}(m, \operatorname {gcd}(n,p))$. In particular, $d_1$ divides $d_2$. Now exchange the roles of $d_1, d_2$ and conclude that $d_2$ divides $d_1$, which implies $d_1=d_2$.
This is a special case of a much more general result, and is best proved at a higher level of generality.
Proposition. Let $P$ denote a poset. Let $a,b$ and $c$ denote elements of $P$, such every subset of $\{a,b,c\}$ has a join. Then: $$(a \vee b) \vee c = a \vee (b \vee c).$$
We then get the desired result in the special case where $P$ is the poset $(\mathbb{N},\mid^{op})$, in which case $\vee$ is just the $\mathrm{gcd}$. (If you don't know what the hell I'm talking about, I suggest getting yourself a good book on the matter. Order theory is both beautiful and useful. Davey and Priestley's book is a pretty good place to start.)
Proof.
Consider $k \in P$. Then the following are equivalent:
Hence: $$\forall k \in P(k \geq (a \vee b) \vee c \iff k \geq a \vee (b \vee c))$$
Hence: $$(a \vee b) \vee c = a \vee (b \vee c)$$
Like every proof in order theory, the above is based on the "Yoneda lemma for posets":
Proposition. Let $P$ denote a partially ordered set. Let $a$ and $b$ denote elements of $P$. Then: $$a \geq b \iff \forall k \in P(k \geq a \implies k \geq b)$$
This implies
Corollary. Let $P$ denote a partially ordered set. Let $a$ and $b$ denote elements of $P$. Then: $$a = b \iff \forall k \in P(k \geq a \iff k \geq b)$$
Hint $\ d\mid (m,n),p \iff d\mid m,n,p\iff d\mid m,(n,p)\ $ so $\,(m,n),p\,$ and $\,m,(n,p)\,$ have the same set $\,S\,$ of common divisors, hence the same greatest common divisor $(= \max S)$.
Above we employed twice the gcd universal property $\, d\mid (a,b)\iff d\mid a,b$.