[Example 3.2.5] Let $x_{1}, x_{2}, \cdots, x_{n}$ take values in some interval of length 1, and let
$$
\begin{array}{l}
x=\frac{1}{n} \sum_{j=1}^{n} x_{j}, \\
y=\frac{1}{n} \sum_{j=1}^{n} x_{j}^{2} .
\end{array}
$$

Find the maximum value of $f=y-x^{2}$.