Let $n$ be a given integer such that $n\ge 2$. Find the smallest real number $\lambda$ with the following property: for any real numbers $x_1,x_2,\ldots ,x_n\in [0,1]$ , there exists integers $\varepsilon_1,\varepsilon_2,\ldots ,\varepsilon_n\in\{0,1\}$ such that the inequality $$\left\vert \sum^j_{k=i} (\varepsilon_k-x_k)\right\vert\le \lambda$$holds for all pairs of integers $(i,j)$ where $1\le i\le j\le n$.
1. **Reformulate the Problem:**
   We need to find the smallest real number $\lambda$ such that for any real numbers $x_1, x_2, \ldots, x_n \in [0,1]$, there exist integers $\varepsilon_1, \varepsilon_2, \ldots, \varepsilon_n \in \{0,1\}$ satisfying:
   \[
   \left\vert \sum_{k=i}^{j} (\varepsilon_k - x_k) \right\vert \le \lambda
   \]
   for all pairs of integers $(i, j)$ where $1 \le i \le j \le n$.

2. **Introduce Partial Sums:**
   Define the partial sums:
   \[
   s_i = \sum_{k=1}^{i} x_k \quad \text{and} \quad t_i = \sum_{k=1}^{i} \varepsilon_k
   \]
   with $s_0 = 0$ and $t_0 = 0$. The inequality can be rewritten as:
   \[
   \left\vert (t_j - s_j) - (t_{i-1} - s_{i-1}) \right\vert \le \lambda
   \]
   for all $0 \le i-1 \le j \le n$.

3. **Simplify the Expression:**
   This simplifies to:
   \[
   \max_{0 \le j \le n} (t_j - s_j) - \min_{0 \le i \le n} (t_i - s_i) \le \lambda
   \]

4. **Construct a Specific Example:**
   Consider the sequence $x_1 = x_2 = \cdots = x_n = \frac{1}{n+1}$. Then:
   \[
   s_i = \frac{i}{n+1}
   \]
   We need to find $\varepsilon_i \in \{0, 1\}$ such that:
   \[
   \max_{0 \le j \le n} (t_j - s_j) - \min_{0 \le i \le n} (t_i - s_i) \le \lambda
   \]

5. **Pigeonhole Principle Application:**
   By the pigeonhole principle, there exists a $k$ such that $\{s_i\} \notin \left(\frac{k}{n+1}, \frac{k+1}{n+1}\right)$ for all $0 \le i \le n$. Define:
   \[
   t_i = \begin{cases} 
   \lfloor s_i \rfloor & \text{if } \{s_i\} \le \frac{k}{n+1} \\
   \lceil s_i \rceil & \text{if } \{s_i\} \ge \frac{k+1}{n+1}
   \end{cases}
   \]

6. **Bound the Difference:**
   This ensures:
   \[
   t_i - s_i \in \left[-\frac{k}{n+1}, \frac{n-k}{n+1}\right]
   \]
   Therefore:
   \[
   \max_{0 \le j \le n} (t_j - s_j) - \min_{0 \le i \le n} (t_i - s_i) \le \frac{n-k}{n+1} - \left(-\frac{k}{n+1}\right) = \frac{n}{n+1}
   \]

7. **Verify $\varepsilon_i \in \{0, 1\}$:**
   Finally, check that $\varepsilon_i = t_i - t_{i-1} \in \{0, 1\}$ for all $1 \le i \le n$. This is true by construction.

Thus, the smallest $\lambda$ satisfying the given condition is $\frac{n}{n+1}$.

The final answer is $\boxed{\frac{n}{n+1}}$