I'm invisible, from the spell Invisibility.
I cast Message to send a whisper to the bad guy.
Does that render me visible again as per the Invisibility spell?
Actually, strictly spoken it does.
Invisibility (emphasis mine):
The spell ends if the subject attacks any creature. For purposes of this spell, an attack includes any spell targeting a foe or whose area or effect includes a foe.
I don't think I've ever met a DM who would rule it this way. But a DM that sticks strictly to RAW might cause message to break invisibility. Hell, pure RAW bless can break invisibility.
So yes it can, though basically no DM would rule it that way.
No, you remain invisible (unless the duration has run out or something else ends it).
The casting of message and sending it to the evil guy does not count as an attack. It is a form of communication such as if you were to cast comprehend languages or simply speak out loud (which if you did would allow them to guess your location and attack).