Strange problem with quality, what might be the reason for these bubbles?
Looking at the second photograph and the way that the filament switches abruptly from smooth to irregular deposition, I would say that you have a partially clogged nozzle.

Pre-heat the nozzle and extrude some filament. It should drop straight down from the nozzle. If the filament curls as it comes out of the nozzle, the nozzle is partially clogged. You may be able to clear the clog by doing what is called a "cold pull":

Pre-heat the nozzle so that it is possible to extrude filament. Then switch off the heater and allow the temperature to fall below the pre-heat temperature of the filament (140°C for PLA, say). Now disengage the extruder gears and gently withdraw the filament completely from the hot end. On removing the filament completely from the printer, you should find a "bullet" on the end of the filament in the shape of the melt chamber. Hopefully, the dirt that caused the clog will be embedded in the bullet.

In order to prevent dirt from entering the nozzle, it is a good idea to install a filament cleaner. This can be as simple as a piece of sponge containing a couple of drops of light machine oil, or you can make something a little more sophisticated. There are plenty of designs that you can download on Thingiverse.