If this monitor does the same on another Mac (or possibly PC if it has the same connections), have your monitor repaired; If it's fine on another Mac, have your Mac repaired.
Alternatively: if this Mac does fine with another monitor, have your monitor repaired; if this Mac doesn't work even with another monitor, have your Mac repaired.

It's more likely to be a monitor issue than a Mac issue. So if you can't find out yourself, I'd take the monitor to your favorite shop for a test first.