The following theorem seems to be well-known; it can be found in Bondy and Murty's book Graph Theory (GTM 244,Page 306, Exercise 12.2.7), where the authors of the book attribute it to Erdős, but do not specify the source. I would like to inquire about which article by Erdős obtains it.
Theorem 1. Let $G$ be a simple nonbipartite graph with $m>\frac{1}{4}(n-1)^2+1$ (where $m$ and $n$ are the numbers of edges and vertices, respectively). Then $G$ contains a triangle.
P.S. we can see the proof in Prove that : $f(n) \le \frac{1}{4}(n-1)^2+1 $