<s>[INST] Prove that $\frac{n}{3} \le \sum_{i = 1}^n\frac{(n - y)^2}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2} \le \sum_{i = 1}^n\frac{1}{x_i^2 + x_i + 1}$. 
Given $0 < y < 1 < n \in \mathbb Z^+$ and $n$ positives $x_1, x_2, \cdots, x_{n - 1}, x_n$ such that $\displaystyle \sum_{i = 1}^nx_i = n$.
Prove that $$\large \frac{n}{3} \le \sum_{i = 1}^n\frac{(n - y)^2}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2} \le \sum_{i = 1}^n\frac{1}{x_i^2 + x_i + 1}$$

We have that
$$\sum_{i = 1}^n\frac{(n - y)^2}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2} - \frac{n}{3}$$
$$\frac{y}{3} \cdot \sum_{i = 1}^n\frac{(x_i - 1)(2n - x_iy - 2y)}{x_i^2y^2 + x_iy^2 + y^2 - 3nx_iy - 3ny + 3n^2}$$
and
$$\sum_{i = 1}^n\frac{1}{x_i^2 + x_i + 1} - \sum_{i = 1}^n\frac{(n - y)^2}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2}$$
$$ = n \cdot \sum_{i = 1}^n\frac{(x_i - 1)(nx_i + 2n - 2x_iy - y)}{(x_i^2 + x_i + 1)(x_i^2y^2 + x_iy^2 + y^2 - 3nx_iy - 3ny + 3n^2)}$$
So that's no help.
Besides, $$\sum_{i = 1}^n\frac{(n - y)^2}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2}$$ is a concave function.
So Jensen's inequality could help here, but I don't know how.
 [/INST] The left inequality.
We need to prove that
$$\sum_{i=1}^n\left(\frac{(n - y)^2}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2}-\frac{1}{3}\right)\geq0$$ or
$$\sum_{i=1}^n\frac{(x_i-1)(3n-2y-yx_i)}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2}\geq0$$ or  $$\sum_{i=1}^n\left(\frac{(x_i-1)(3n-2y-yx_i)}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2}-\frac{x_i-1}{n-y}\right)\geq0$$  or
$$\sum_{i=1}^n\frac{(x_i-1)^2(2n-y-yx_i)}{y^2(x_i^2 + x_i + 1) - 3ny(x_i + 1) + 3n^2}\geq0,$$ which is obvious.
For $n\geq3$ we can prove a right inequality by the same way.
Also, easy to check that the right inequality is true for $n=2$.
</s>