Yes you can heat coffee up in a Styrofoam cup in the microwave.
Styrofoam cups are microwave safe and you can place them in the microwave and heat up coffee, water, hot chocolate etc.
I've been microwaving Styrofoam cups for years now and never had one melt.
You can also microwave those Styrofoam food containers to reheat food in as I've done it several times before as well.
Just don't put gasoline in a Styrofoam cup as the gasoline will melt the Styrofoam cup.
However microwaving Styrofoam cups and Styrofoam food containers is safe and never have I had an issue doing so.