Let $m,n$ be distinct positive integers. Prove that 
$$gcd(m,n) + gcd(m+1,n+1) + gcd(m+2,n+2) \le 2|m-n| + 1. $$
Further, determine when equality holds.
1. **Lemma 1:** For \(a, b \in \mathbb{Z}^{+}\) with \(a > b\), we have \(\gcd(a, b) = \gcd(a, a - b)\).

   **Proof:** Denote \(\gcd(a, b) = d\). Then \(d \mid a\) and \(d \mid b\), which implies \(d \mid (a - b)\). Therefore, \(d \mid \gcd(a, a - b)\). Let \(\gcd(a, a - b) = d_0\). Then \(d_0 \mid a\) and \(d_0 \mid (a - b)\), which implies \(d_0 \mid b\). Hence, \(d_0 \mid \gcd(a, b)\), which implies \(d_0 \leq d\). Since \(d \mid d_0\), we have \(d = d_0\). \(\blacksquare\)

2. **Lemma 2:** For \(a, b \in \mathbb{Z}^{+}\) with \(a > b\), we have \(\gcd(a, b) \leq b\).

   **Proof:** Since \(\gcd(a, b) \mid b\), we can write \(b = \ell \cdot \gcd(a, b)\) for some \(\ell \in \mathbb{Z}^{+}\). If \(\gcd(a, b) > b\), it leads to a contradiction. Hence, \(\gcd(a, b) \leq b\). \(\blacksquare\)

3. **Lemma 3:** If \(\gcd(a, b) = d \neq 1\), then \(1 \leq \gcd(a \pm 1, b) \leq \frac{b}{2}\).

   **Proof:** Set \(a = dx\) and \(b = dy\) where \(\gcd(x, y) = 1\). Thus, \(y = \frac{b}{d}\). Since \(d > 1\), we have \(y \leq \frac{b}{2}\). Also, \(a + 1 = dx + 1\) and \(b = dy\). If \(\gcd(a + 1, b) = \mathcal{T}\), then \(\mathcal{T} \mid dx + 1\) and \(\mathcal{T} \mid dy\), which implies \(\mathcal{T} \mid y\). Hence, \(\mathcal{T} \leq y \leq \frac{b}{2}\). Similarly, the case for \(a - 1\) follows. \(\blacksquare\)

4. Now consider \(z = \gcd(m + 1, n + 1)\).

   **Case 1:** If \(z = 1\), then 
   \[
   \sum_{i=0}^{2} \gcd(m+i, n+i) = \gcd(m, |m-n|) + \gcd(m+1, |m-n|) + \gcd(m+2, |m-n|).
   \]
   Using **Lemma 2**, we have 
   \[
   \gcd(m, |m-n|) + \gcd(m+1, |m-n|) + \gcd(m+2, |m-n|) \leq 1 + 2|m-n|.
   \]

   **Case 2:** If \(z \neq 1\), from **Lemma 3**, we have 
   \[
   \sum_{i=0}^{2} \gcd(m+i, n+i) = \gcd(m, |m-n|) + \gcd(m+1, |m-n|) + \gcd(m+2, |m-n|) \leq |m-n| + \frac{|m-n|}{2} + \frac{|m-n|}{2} = 2|m-n| < 2|m-n| + 1.
   \]

   Therefore, we conclude that 
   \[
   \gcd(m, n) + \gcd(m+1, n+1) + \gcd(m+2, n+2) \leq 2|m-n| + 1.
   \]
   \(\blacksquare\)

5. **Case of Equality:**

   Since we can't have equality in the case of \(z \neq 1\), we must have \(\gcd(m+1, |m-n|) = 1\). Also, we have \(\gcd(m, |m-n|) = |m-n|\) and \(\gcd(m+2, |m-n|) = |m-n|\), which implies \((|m-n|) \mid m\) and \((|m-n|) \mid (m+2)\). This implies \((|m-n|) \mid 2\), so \(|m-n| = 1\) or \(|m-n| = 2\).

   Therefore, the case of equality holds for 
   \[
   \boxed{\{ (m, m-1), (m, m+1), (m, m-2), (m, m+2) \}}.
   \]
   \(\blacksquare\)