Statistical Proof of Turán’s Graph Theorem: Weight of Vertex Uniformly Distributed? If a graph $G = (V, E)$ on $n$ vertices has no $p$-clique, $p \geq 2$,
then, $|E| \leq (1- \frac{1}{p-1}) \frac{n^2}{2} \cdots (1)$. We get a proof from the book "Proofs from THE BOOK" as given below- 

Now I could not understand below line-

We infer that the maximal value of $f(w)$ is attained for   $ w_i =
\frac{1}{k} $ on a $k$-clique...

because, then it menas that all vertices have same weight, but earlier, it was assumes that- 

Suppose $w$ is any distribution

In general, can anyone please explain how one can infer that the maximal value of $f(w)$ is attained for   $ w_i =\frac{1}{k} $ from $f(w')=f(w)+\epsilon (w_1-w_2)$ ?
 A: We start with a distribution $\boldsymbol w$ which maximizes $f$. [The proof doesn't say that we do this, because it phrases things slightly differently, but things are slightly easier to understand if this is our starting assumption.]
In the first step, the proof shows that if two non-adjacent vertices have positive weight in $\boldsymbol w$, we can replace $\boldsymbol w$ by a different distribution $\boldsymbol w'$ with $f(\boldsymbol w') \ge f(\boldsymbol w)$ (so $\boldsymbol w'$ still maximizes $f$) but which puts positive weight on only one of these vertices.
Next, the idea is that we keep doing this operation for as long as possible. Every time we do it, the number of vertices with positive weight decreases, so we won't keep doing it forever. Once we're done, there can't be two non-adjacent vertices with positive weight in the final distribution $\boldsymbol w$. This means that if we let $S$ be the set of vertices with positive weight, all vertices in $S$ must be adjacent.
We let $k = |S|$. This is the point we're at when the proof says "there is an optimal distribution whose nonzero weights are concentrated on a clique, say a $k$-clique".
Next, we're going to use a similar argument with a different operation that - if possible - will increase the value of $f$. That operation is "take two vertices $i,j \in S$ with $w_i > w_j > 0$, and replace their weights by $w_i - \epsilon$ and $w_j + \epsilon$". It's possible to do this if $S$ contains any two vertices with unequal weights.
The inequality we get for this operation shows that when we do it, we increase $f$. But we can't increase $f$: we assumed that we started with a distribution $\boldsymbol w$ which maximizes $f$! So this operation must not be possible. This means that all vertices in $S$ have equal weights in $\boldsymbol w$.
At this point, we can calculate $f(\boldsymbol w)$ exactly: there are $\binom k2$ pairs of vertices in $S$, each pair is adjacent, and for each pair, the contribution to $f$ is $\frac1k \cdot \frac1k = \frac1{k^2}$. So $f(\boldsymbol w) = \binom k2 \frac1{k^2}$ is the highest possible value of $\boldsymbol w$.
