What is the purpose of a dorsal fin such as on the Boeing 737?
The "extension" at the front is called "dorsal fin". Its main purpose is to improve directional stability in high side-slip situations (asymmetric flight due to engine failure, crosswind landings, etc). The double-sweep of the leading edge of the vertical stabilizer helps the vertical stabilizer to be effective at a larger range of side-slip angles (high lateral angles of attack).

The stabilizer is an airfoil, much like a wing. The amount of lift (or in this case, sideways force) it generates, varies with its angle of attack (AoA, or $\alpha$), or in this case, sideslip-angle ($\beta$) something like this:



Lift coefficient ($C_L$) increases with increased $\alpha$, until it reaches $C_{L_{MAX}}$. This angle is called $\alpha_{crit}$.

Generally, the more sweepback an airfoil has, the lower its $C_{L_{MAX}}$, BUT the higher its $\alpha_{crit}$. This means that the non-dorsal-fin-part of the stabilizer (low sweepback) will be able to generate its $C_{L_{MAX}}$ (sideways lift) at a lower $\beta$ than the dorsal fin. Increasing the side-slip angle beyond its $\beta_{crit}$ decrease the amount of sideways force it generates. By using a secondary airfoil (the dorsal fin), with a higher sweep angle, (ie, higher $\beta_{crit}$), the net loss in sideways force with increased side-slip may be avoided, or at least mitigated. Further, at high $\alpha$, (or in this case, with a vertical stabilizer $\beta$), a delta with high sweepback will generate a vortex, which will follow the upper side of the surface down-stream of it, adding kinetic energy to its airflow, thus enhancing its effectiveness.

The current version of the dorsal fin was added to the Boeing 737 with the Classic (−300 and onwards), but the design is not unique for the Boeing 737. Look the Cessna 172 for instance (Wikimedia Commons): 


The ATR 72 doesn't have a "pronounced" dorsal fin, but you can still see clearly how the sweepback of the vertical stabilizer changes along its length (Wikimedia Commons):
 

Or, on the other side of the speed spectrum (Wikimedia Commons):