What is this extension/device on top of the wing of this ultralight?
Those are wing fences and they prevent airflow perpendicular to the direction of travel. This isolates the portions of the wing and allows the inner wing to stall independently of the outer wing.

Since the wing uses flaps, the inner portion will create more lift and stall (separation of airflow on the upper wing leading to loss of lift) at a lower angle of attack. Wing fences prevent this stall from extending over the outer part with the ailerons, so the airplane will stay controllable in a stall and will not suddenly drop one wing.