To prove that the chromatic number of G is 2 if and only if G is bipartite, we will show both implications:
1. If the chromatic number of G is 2, then G is bipartite:
If the chromatic number of G is 2, then we can color the vertices of G with only 2 colors. This implies that the graph can be partitioned into 2 disjoint sets such that each edge of the graph connects vertices from different sets. Therefore, G is bipartite.
2. If G is bipartite, then the chromatic number of G is 2:
If G is bipartite, we can partition the vertices of G into 2 disjoint sets such that each edge of the graph connects vertices from different sets. Since no two vertices within the same set are adjacent, we can color the vertices in one set with one color and the vertices in the other set with a different color. This demonstrates that the chromatic number of G is 2.
Therefore, we have shown both implications:
"If the chromatic number of G is 2, then G is bipartite" and "If G is bipartite, then the chromatic number of G is 2", which completes the proof.
\textbf{Answer:} The chromatic number of G is 2 if and only if G is bipartite.