Can a commercial airline continue its flight if its landing gear fails to retract after take-off?
Usually not. It depends on various factors, most importantly the available fuel. If the pilot decides that enough fuel is available even after accounting for the extra drag due to extended landing gear, he can decide to continue, though this will rarely be the case as the drag penalty is too high and the aircraft speed is limited.

A case in point is the Hapag-Lloyd Flight 3378, which crash landed due to fuel starvation caused by the extended landing gear (which was kept that way as a precaution). The pilot was criticized for his decision to keep on flying instead of diverting to another airfield, and given a suspended prison sentence.