Is it a problem in a single-phase system, if a generator shares neutral with the grid?
There is NO problem with the neutral conductor remaining connected.  Most electrical codes REQUIRE the neutral to remain connected between the main (grid) supply and the backup supply.  Also note that the neutral conductor is bonded to earth ground, usually at the meter socket.

Be aware that most electrical codes require the use of a transfer switch between the grid and backup supply.  This is a switch that has mechanical interlock to guarantee that under no circumstances will you ever back-feed generator power back into the utility lines.