Let $G=(V,E)$ be a graph, $|V|=n$, $|E|=m$. Show that
$\displaystyle \sum_{v\in V}{d(v)\choose{2}}\geq \frac{n}{2}(\frac{2m}{n} - 1)^{2}$
This is from a Theorem that state $\operatorname{ex}(n,C_{4})=O(n^{3/2})$, and the autor afirm that is true by convexity.
Recall Jensen's inequality: For a real convex function $f$, numbers $x_{1},x_{2},...,x_{n}$ in the domain of $f$, and weights $0\leqslant t_{1},t_{2},...,t_{n}\leqslant 1$ satisfying $\sum_{i=1}^{n} t_{i} =1$, we have $$\sum_{i=1}^{n} t_{i}f(x_{i})\geqslant f\left(\sum_{i=1}^{n} t_{i}x_{i}\right).$$ We apply this to $f(x)=\binom{x}{2}=\frac{x(x-1)}{2}$. By considering the second derivative, it is easy to show that $f$ is indeed convex. We write $V=\{v_{1},...,v_{n}\}$ and then take $x_{i}=d(v_{i})$. Take $t_{j}=\frac{1}{n}$ for all $j$. This gives us $$\sum_{v\in V}\frac{1}{n}\binom{d(v)}{2}\geqslant f\left(\frac{1}{n}\sum_{v\in V}d(v)\right).$$
By the handshaking lemma, we know that $\sum_{v\in V}d(v)=2m$. Substituting this in the above inequality and multiplying both sides by $n$ gives the required result$$\sum_{v\in V}\binom{d(v)}{2}\geqslant \frac{n}{2}\cdot \frac{2m}{n}\cdot\left(\frac{2m}{n} - 1\right)\geqslant \frac{n}{2}\left(\frac{2m}{n} - 1\right)^{2}.$$