"This happens even on a startup sometimes" sounds like a hardware issue then.
With the power off and unplugged from wall socket: First thing to do is to make sure you haven't got any loose cables as this can cause the symptoms you describe. Make sure the keyboard and mouse and all other cables on back of pc are plugged in tightly. If they are okay and you still get same problems open the tower up and check all the cables inside. Take out and reseat (put back in again) the RAM modules etc.