If $n-1$ is the chromatic number of a graph on $n$ vertices, then $n-1$ is also its clique number I would be very grateful for any ideas. According to the drawings, this statement is clear, I just don't know how to formulate it exactly.
My teacher suggested that: I should try to prove that if an $n$-vertex graph does not contain $K_{n-1}$ as a subgraph, then you can color it using $n-2$ colors.
I'm missing something, please help!
 A: Hints.

*

*If a graph $G$ on $n$ vertices is not a complete graph, then $\chi(G)\leq n-1$ (two non-adjacent vertices can be colored the same).


*If graph $G$ has two pairs of non-adjacent vertices $x_1,x_2$ and $y_1,y_2$ and these four vertices are pairwise different, then $\chi(G)\leq n-2$ (vertexes $x_1,x_2$ are colored in the same color, and $y_1,y_2$ also in the same but different color).


*If graph $G$ has three pairwise non-adjacent vertices, then $\chi(G)\leq n-2$ (these three vertices can be colored in the same color).


*If $\chi(G)=n-1$ and we took a proper vertex coloring, then there are exactly two vertices of the same color $x$ and $y$ and all other vertices have pairwise different colors.
Now we have to use the hints one by one to prove that $G$ contains $K_{n-1}$.
Addition.
Let $V(G)=\{v_1,v_2,\ldots,v_{n-2},x,y\}$ and $v_1,v_2,\ldots,v_{n-2}$ have different colors. By virtue of 1, the vertices $v_1,v_2,\ldots,v_{n-2}$ are pairwise adjacent (otherwise $\chi(G)=n-2$).
Prove that at least one of the vertices $x$ or $y$ is adjacent to all vertices $v_1,v_2,\ldots,v_{n-2}$. Reason in contrary way. Let $x$ be non-adjacent to $v_i$ and $y$ be non-adjacent to $v_j$ for some $i$, $j$.
If $i\neq j$, then by 2 $\chi(G)\leq n-2$, which by convention is not true.
If $i= j$ then we have three pairwise non-adjacent vertices $x,y,v_i$ and by 3 $\chi(G)\leq n-2$.
So in any case we get a contradiction and so one of the vertices $x,y$ is adjacent to all $v_1,v_2,\ldots,v_{n-2}$. Let it be $x$, for example. Then the subgraph $\langle v_1,v_2,\ldots,v_{n-2},x\rangle$ is a complete graph on $n-1$ vertices.
That's it.
