Yes, the sentence “Shouldn’t you let me know before inviting someone for dinner?” is grammatically correct. It is properly formed as a question and conveys the meaning that the speaker expects to be informed prior to someone being invited for dinner.