2. For every positive integer $n$, find the largest constant $c_{n}$ with the following property: for any $n$ real-valued functions $f_{1}(x), f_{2}(x), \cdots$, $f_{n}(x)$ defined on the closed interval $[0,1]$, there exist real numbers $x_{1}, x_{2}, \cdots, x_{n}$, such that $0 \leqslant x_{i} \leqslant 1$ $(i=1,2, \cdots, n)$, and
$$
\left|f_{1}\left(x_{1}\right)+f_{2}\left(x_{2}\right)+\cdots+f_{n}\left(x_{n}\right)-x_{1} x_{2} \cdots x_{n}\right| \geqslant c_{n} \text {. }
$$
2. The desired maximum constant $c_{n}=\frac{n-1}{2 n}$.

On one hand, taking $x_{1}=x_{2}=\cdots=x_{n}=1$, we get
the left side of equation (1) $=\left|\sum_{i=1}^{n} f_{i}(1)-1\right|$;
taking $x_{1}=x_{2}=\cdots=x_{n}=0$, we get
the left side of equation (1) $=\left|\sum_{i=1}^{n} f_{i}(0)\right|$;
taking $x_{i}=0, x_{j}=1(j \neq i)$, we get
the left side of equation (1) $=\left|\sum_{j \neq i} f_{j}(1)+f_{i}(0)\right|$.
By the triangle inequality, we have
$$
\begin{array}{l}
(n-1)\left|\sum_{i=1}^{n} f_{i}(1)-1\right|+ \\
\sum_{i=1}^{n}\left|\sum_{j \neq i} f_{j}(1)+f_{i}(0)\right|+\left|\sum_{i=1}^{n} f_{i}(0)\right| \\
\geqslant \mid(n-1)\left(\sum_{i=1}^{n} f_{i}(1)-1\right)- \\
\sum_{i=1}^{n}\left(\sum_{j \neq i} f_{j}(1)+f_{i}(0)\right)+\sum_{i=1}^{n} f_{i}(0) \\
=n-1 \text {. } \\
\end{array}
$$

Therefore, $\left|\sum_{i=1}^{n} f_{i}(1)-1\right|,\left|\sum_{i=1}^{n} f_{i}(0)\right|,\left|\sum_{j \neq i} f_{i}(1)+f_{i}(0)\right|$ $(i=1,2, \cdots, n)$ must have at least one number not less than $\frac{n-1}{2 n}$.
Thus, $c_{n} \geqslant \frac{n-1}{2 n}$.
On the other hand, let
$$
f_{i}(x)=\frac{x}{n}-\frac{n-1}{2 n^{2}}(i=1,2, \cdots, n) \text {. }
$$

Next, we prove that for any real numbers $x_{1}, x_{2}, \cdots, x_{n} \in$ $[0,1]$, we have
$$
\left|f_{1}\left(x_{1}\right)+f_{2}\left(x_{2}\right)+\cdots+f_{n}\left(x_{n}\right)-x_{1} x_{2} \cdots x_{n}\right| \leqslant \frac{n-1}{2 n} \text {. }
$$

For this, it suffices to prove:
$$
1-n \leqslant n x_{1} x_{2} \cdots x_{n}-\sum_{i=1}^{n} x_{i} \leqslant 0 \text {. }
$$

The left inequality is equivalent to
$$
\begin{array}{l}
(n-1) x_{1} x_{2} \cdots x_{n}+\left(x_{1}-1\right)\left(x_{2} x_{3} \cdots x_{n}-1\right)+ \\
\cdots+\left(x_{n-1}-1\right)\left(x_{n}-1\right) \geqslant 0 .
\end{array}
$$

Each term in the sum is not less than 0, so it holds.
The right inequality is equivalent to
$$
\begin{array}{l}
\sum_{i=1}^{n} x_{i}-n x_{1} x_{2} \cdots x_{n} \geqslant 0 \\
\Leftrightarrow \sum_{i=1}^{n} x_{i}\left(1-\frac{x_{1} x_{2} \cdots x_{n}}{x_{i}}\right) \geqslant 0 .
\end{array}
$$

Similarly, it also holds.