The number of edges in non-bipartite, triangle-free graph This is an Exercise 1.1.4. from Yufei Zhao's book  Graph Theory and Additive Combinatorics.

Prove that every $n$-vertex non-bipartite triangle-free graph has at
most $(n-1)^2/4+1$ edges.

My approach: Suppose that $v$ is a vertex of maximal degree. Consider $A:=N(v)$, then $A$ is an independent set since $G$ is triangle-free graph. Let $B:=V\setminus A$, then $A,B$ is a partition of $V$. Since $G$ is a non-bipartite graph, then there is an edge $\tilde{e}=b_1b_2$, where $b_1,b_2\in B$.
Hence $$e(G)-1\leq \sum \limits_{x\in B\setminus\{b_1,b_2\}} \deg(x)+(\deg(b_1)-1)+(\deg(b_2)-1).$$
$$e(G)\leq \sum \limits_{x\in B\setminus\{b_1,b_2\}} \deg(x)+(\deg(b_1)+\deg(b_2))-1.$$
Since $b_1b_2$ is an edge, then $\deg(b_1)+\deg(b_2)\leq n$. Hence
$$e(G)\leq |A|(|B|-2)+n-1,$$ where $|A|+|B|=n$. Hence $e(G)\leq |A||B|-|A|+|B|-1\Rightarrow$
$$e(G)\leq (|B|-1)(|A|+1).$$
But it does not imply the inequality which I need to prove. I guess that I am not using the condition that $G$ is non-bipartite fully.
 A: I am sure there is something missing in my answer.
I would like to Post it here to get feedback.
A graph becomes non-bipartite when even 1 node makes bipartition impossible.
Same thing in other words: A graph is non-bipartite when even 1 node prevents bipartitioning.
Let us remove that 1 node to get $(n-1)$ nodes remaining.
In case this is bipartite, the maximum number of edges is $((n-1)/2)^2 = (n-1)^2/4$ with equal Partitions.
Put back the removed node with 2 edges to get non-bipartite graph with $(n-1)^2/4+2$ edges.
Putting back with 2 edges will introduce a triangle. Thus, we must remove 1 edge to remove that triangle. Thus, $(n-1)^2/4+1$ is the maximum number of edges in the non-bipartite graph without a triangle.

Elaboration:
[[ This was the "Missing Part" in my Answer ]]
A graph is BiPartite if we can make 2 Partitions out of the nodes; A graph is Non-BiPartite if we can not make 2 Partitions. Why we can not make Partition ? Because when we try putting the nodes in one Partition or the other, we will eventually get a node which can not be put in either Partition. There may be more such nodes, but even one such node is enough to make the graph Non-BiPartite.
In the given Book, Page 12, there is Discussion about BiPartite graphs being the "unique maximizer of the number of edges among -vertex triangle-free graphs" with Mantels Theorem giving the maximum number of edges.
This maximum is not achieved by all graphs; It is achieved by only the extremal graphs.
Thus "In the extremal case, there is only 1 node which prevents BiPartitioning" OR "When that Particular node is removed and still it is Non-BiPartite, then it is not extremal" ; This is why I can remove one Particular node (which I call ODD node because the other nodes can be EVENLY put in 2 Partitions) to get a BiPartite graph.
When I put this Particular node back, I have to ensure that there is no triangle, which I do by removing one edge.
