"When what you really should do is ***"
I was wondering whether the following sentence is grammatically correct:
It's remarkable how many ideas for interesting programming projects pop up in your head when what you really should do is to study!
Is to study used correctly? Or should it just be study?
Yes, it is correct, but normally we omit "to" from an infinitive when it isn't serving as a noun phrase. The effect of putting the "to" back in is to make the statement sound very strong. It works quite well if you imagine the speaker raising his/her voice towards the end of the sentence and really punching out those last few words.