Nitrogen (periodic table: N, molecule N2) is the most abundant atmospheric element in the Earth's atmosphere, making up 78% of the total atmospheric gas. Mars, however, has less nitrogen in it's atmosphere, only 3% of the total atmospheric gas (and Mars has only 0.6% of Earth's pressure). The most common Isotope has 7 neutrons for an average atomic mass of 14.
Nitrogen is one of the "CHNOPS" elements (Carbon, Hydrogen, Nitrogen, Oxygen, Phosphorus, & Sulfur – the elements which are needed in quantity for life), so it will be required for life support.
Gaining Nitrogen Locally
The "nitrogen cycle" is an essential terrestrial process that produces organic compounds intrinsic to life on Earth. "Fixing" by lightning strikes or bacterial processes combine atmospheric nitrogen with other elements (such as hydrogen, producing ammonia) producing organic compounds required for plants (sustaining growth and used in photosynthesis), thereby supporting ecosystems. Nitrogen can be found in amino acids, proteins and DNA, making it an essential component of life as we know it.
The relative scarcity of nitrogen in Mar's atmosphere will cause an expense for colonists on Mars as the existing atmosphere must be processed to separate out CO2. As the CO2 is required for propellant production, the concentration of Nitrogen to breathable levels becomes part of the propellant production cycle.
Producing in-situ nitrogen from the martian atmosphere by atmospheric processing will be an important process for a martian settlement. For a stand-alone nitrogen production process, where the nitrogen is separated by cooling, the cooling needed to liquefy the carbon dioxide is mainly provided by evaporating the liquid carbon dioxide after the nitrogen has been removed. Likewise the power for compressing the carbon dioxide is partially provided by expanding the output waste through a turbine with a common shaft with the compressor. Some energy is required to offset system losses and the Carnot cycle is not perfectly reversible. However, for a system that also compressed the atmosphere to produce CO2 for propellant production, the energy to compress the CO2 will not be available.
Nitrogen Deposits On Mars
Lightning in a nitrogen atmosphere will form nitrates. On Earth, these nitrates fertilize the soil or ocean, and life recycles them. On Mars it is likely that beds of nitrates have built up, however this is speculation, such deposits would likely be buried, and in any case have not yet been found.
If such deposits are found, they will be an important biological resource for future Settlements, and may help determine settlement locations.
In an important paper in 2015, it was found that nitrates existed in the soil of Mars. This hints that there may have been nitrogen fixation going on at some time in the past. If this is widespread, it would be very good news since the Nitrogen is biologically accessible, and if released to the atmosphere, would result in a 0.3 Bar partial pressure. 
Nitrates with a concentration of ~100 ppm have been found in typical Martian soils. Assuming that no richer deposits are found, this suggests that to get Mars' atmospheres partial pressure up to 0.3 atmospheres, (a level required for a nitrogen life cycle), would require freeing Nitrogen from 30 cubic kilometres of soil. This is a vast amount of dirt to process, but if any nitrate deposits are found (say with 100 times the concentration), then the required volume becomes much more realistic. Also note, that existing nitrate deposits can easily provide enough nitrogen for habitats.
Note that Curiosity found Nitrate deposits in Gale Crater from ~110 to ~300 ppm. In Mudstone deposits, this value ranged from 300 to 1,100 ppm. They speculate that these compounds were formed from thermal shock from impacts, or from lightning.
Nitrogen from atmospheric processing will probably be used immediately to create the settlement atmosphere. If any excess nitrogen is produced it can be stored in some form of containment, or pressure vessel. The boiling point of nitrogen is -195.79 °C at atmospheric pressure. Unless the nitrogen is actively cooled by a refrigeration system, it will eventually heat up to ambient temperatures and the pressure will increase. If the nitrogen is obtained though CO2 compression to 520 kPa (about 5 atmosphere, or 75 psi) it can remain a liquid if cooled to about -170°C. To keep the nitrogen liquid at a room temperature of 23°C requires a pressure of about 1500 kPa (220 psi). This can be easily maintained in small pressure vessels but requires extremely strong and heavy vessels in large volumes.
It is likely that all the nitrogen obtain through atmospheric processing will become part of the colony atmosphere, at least in the early stages. So large scale storage is not an immediate problem. In all cases nitrogen can be stored at lower pressures when cooled bellow ambient temperatures. However, a refrigeration system is required to do this. If there is sufficient insulation, the heat gain can be quite small and the refrigeration system will also be minimum.
The surface temperature of Mars aids for refrigeration as the average global temperature is approximately -63°C. So the storage location for liquid nitrogen would not be inside habitats (where the average temperature should be as close to 23 °C as possible), but outside, on the cooler surface. Or preferably underground in pressure vessels. This section reflects the personal position of Ioneill
- Settlement atmosphere (main usage).
- Fertilizer, when combined with hydrogen to form ammonia or urea as part of the nitrogen cycle.
- Nitrogen is an essential element of all the amino acids in plant structures which are the building blocks of plant proteins, important in the growth and development of vital plant tissues and cells like the cell membranes and chlorophyll.
- Nitrogen is a component of nucleic acid that forms DNA a genetic material significant in the transfer of certain crop traits and characteristics that aid in plant survival. It also helps hold the genetic code in the plant nucleus.
- Chlorophyll being an organelle essential for carbohydrate formation by photosynthesis and a substance that gives the plant their green color, nitrogen is a component in it that aids in enhancing these features.
- Nitrogen is essential in plant processes such as photosynthesis. Thus, plants with sufficient nitrogen will experience high rates of photosynthesis and typically exhibit vigorous plant growth and development.
- Inert gas for certain industrial processes.
- Explosives component (nitrates).
- May be used to prepare dead bodies prior to disposal. Freezing bodies with liquid nitrogen and then powdering the remains (through vibration) may be a viable means to reuse valuable biomass (in greenhouses etc.).
"Evidence for indigenous nitrogen in the sedimentary and aeolian deposits from the Curiosity rover investigations at Gale crater, Mars", Jennifer C. Stern, Brad Sutter, Caroline Freissinet, and the MSL Science Team, 2015-March-23, 112(14)4245-4250, https://doi.org/10.1073/pnas.1420932112