6. Let $n \geqslant 2, x_{1}, x_{2}, \cdots, x_{n}$ be real numbers, and $\sum_{i=1}^{n} x_{i}^{2}+\sum_{i=1}^{n-1} x_{i} x_{i+1}=$ 1. For each fixed $k(k \in \mathbf{N}, 1 \leqslant k \leqslant n)$, find the maximum value of $\left|x_{k}\right|$.
From the given conditions, we have

That is,
$$
\begin{array}{c}
2 \sum_{i=1}^{n} x_{i}^{2}+2 \sum_{i=1}^{n-1} x_{i} x_{i+1}=2 \\
x_{1}^{2}+\left(x_{1}+x_{2}\right)^{2}+\left(x_{2}+x_{3}\right)^{2}+\cdots+ \\
\left(x_{n-2}+x_{n-1}\right)^{2}+\left(x_{n-1}+x_{n}\right)^{2}+x_{n}^{2}=2
\end{array}
$$

By the mean inequality, we get
$$
\begin{array}{l}
\sqrt{\frac{x_{1}^{2}+\left(x_{1}+x_{2}\right)^{2}+\cdots+\left(x_{k-1}+x_{k}\right)^{2}}{k}} \geqslant \\
\frac{\left|x_{1}\right|+\left|x_{1}+x_{2}\right|+\cdots+\left|x_{k-1}+x_{k}\right|}{k} \geqslant \\
\frac{\left|x_{1}-\left(x_{1}+x_{2}\right)+\cdots+(-1)^{k-1}\left(x_{k-1}+x_{k}\right)\right|}{k}=
\end{array}
$$
$$
\frac{\left|x_{k}\right|}{k}
$$

That is,
$$
x_{1}^{2}+\left(x_{1}+x_{2}\right)^{2}+\cdots+\left(x_{k-1}+x_{k}\right)^{2} \geqslant \frac{x_{k}^{2}}{k}
$$

Similarly,
$$
\begin{array}{l}
\sqrt{\frac{\left(x_{k}+x_{k+1}\right)^{2}+\cdots+\left(x_{n-1}+x_{n}\right)^{2}+x_{n}^{2}}{n-k+1}} \geqslant \\
\frac{\left|x_{k}+x_{k+1}\right|+\cdots+\left|x_{n-1}+x_{n}\right|+\left|x_{n}\right|}{n-k+1} \geqslant \\
\frac{\left|x_{n}-\left(x_{n-1}+x_{n}\right)+\cdots+(-1)^{n-k}\left(x_{k}+x_{k+1}\right)\right|}{n-k+1}= \\
\frac{\left|x_{k}\right|}{n-k+1}
\end{array}
$$

That is,
$$
\left(x_{k}+x_{k+1}\right)^{2}+\cdots+\left(x_{n-1}+x_{n}\right)^{2}+x_{n}^{2} \geqslant \frac{x_{k}^{2}}{n-k+1}
$$

From (2) + (3) and (1), we get
$$
2 \geqslant\left(\frac{1}{k}+\frac{1}{n-k+1}\right) x_{k}^{2}
$$

That is,
$$
\left|x_{k}\right| \leqslant \sqrt{\frac{2 k(n+1-k)}{n+1}}, k=1,2, \cdots, n
$$

From the above, we know that the equality in (4) holds if and only if
$$
x_{1}=-\left(x_{1}+x_{2}\right)=x_{2}+x_{3}=\cdots=(-1)^{k-1}\left(x_{k-1}+x_{k}\right)
$$

and
$$
x_{k}+x_{k+1}=-\left(x_{k+1}+x_{k+2}\right)=\cdots=(-1)^{n-k} x_{n}
$$

That is, when and only when
$$
x_{i}=x_{k}(-1)^{i-k} \frac{i}{k}, i=1,2, \cdots, k-1
$$

and $\quad x_{j}=x_{k}(-1)^{j-k} \frac{n+1-j}{n-k+1}, j=k+1, k+2, \cdots, n$
$$
\left|x_{k}\right|=\sqrt{\frac{2 k(n+1-k)}{n+1}}
$$

In summary, we have
$$
\left|x_{k}\right|_{\max }=\sqrt{\frac{2 k(n+1-k)}{n+1}}
$$