Options -> Game -> F1 to F8. Click next to one of the keys and input whatever you want to say when you press that key. You can use text (like "sorry", "good race") or commands (like "/w pb" to display your PB time on the track/car combo you're currently driving). If you run out of room in the F1 to F8 menu you can put entries in the Ctrl + and Alt + sections.