Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@DominicvanderZypen Furthermore, it can be shown that for any positive integer $k$ and any graph $H$ of order $k$, there exists a graph $G$ with a $k$-rainbow set $S$ (so $\chi(G)=k$) such that the subgraph of $G$ induced by $S$ is [isomorphic to] $H$.
Thank you for all of your comments so far. I have made an edit to address the matter of $k$ being equal to $\chi(G)$. I hope this explains why I originally phrased "rainbow sets" in terms of $k$ rather than $\chi$.