how can a nand gate be used as an inverter
If no specific NOT gates are available, one can be made from NAND or NOR gates, because NAND and NOR gates are considered the "universal gates", meaning that they can be used to make all the others.