If $G$ is simple with diameter two and maximum degree $|V(G)| - 2$, then $|E(G)| \geq 2|V(G)| - 4$ This is my try:
Because the diameter of $G$ is two and have maximum degree the number of vertex: $|V(G)| - 2$, where $|V(G)|$ is the number of vertex, then the grade for any vertex in $G$ is greater than or equal to two. And since $\sum \delta(v_i) = |E(G)|$, where $\delta(v_i)$ represents the grade of a vertex in $V(G)$ and $|E(G)|$ the number of edges in $G$, then $\sum \delta(v_i) \geq 2(|V(G)| - 2) = 2|V(G)| - 4$.
 A: Let $G$ be a graph of diameter $2$ and order $n=|V(G)|$, and suppose that $G$ has a vertex $v$ of degree $n-2$. It is easy to see that $G-v$ is a connected graph. [There is a vertex $u$ of $G-v$ which is not adjacent to $v$; every other vertex of $G-v$ is connected to $u$ by a path in $G$ of length at most $2$; since there is no edge $uv$, that path must be contained in $G-v$.] Since $G-v$ is a connected graph with $n-1$ vertices, it must have at least $n-2$ edges; added to the $n-2$ edges which are incident with $v$, this makes at least $2n-4$ edges in $G$.
Alternatively, without using the fact that a connected graph on $m$ vertices must have at least $m-1$ edges:
Let $N(x)$ denote the neighborhood of vertex $x$, i.e., the set of all vertices adjacent to $x$. Since $|N(v)|=n-2$, there is a unique vertex $u\in V(G)\setminus[\{v\}\cup N(v)]$. Let $X=              N(v)\setminus N(u)$; so $|X|=n-2-|N(u)|$.Each vertex in $X$ is connected to $u$ by a path of length $2$, therefore, each vertex in $X$ is adjacent to some vertex in $N(u)$. Now there are $ n        -2$ edges incident with $v$, and $|N(u)|$ edges incident with $u$, and at least $|X|$ edges joining vertices in $X$ to vertices in $N(u)$.Hence$$|E(G)|\ge(n-2)+|N(u)|+|X|=(n-2)+|N(u)|+(n-2-|N(u)|)=2n-4.$$
