Is it possible to continue using an to external monitor when closing the lid on a Macbook Air?
Yes, its called "closed clamshell" mode. In short, you'll need to attach your MBA to a mouse, a keyboard and power:

https://support.apple.com/HT201834