X-ray photoelectron spectroscopy (XPS) or energy dispersive analysis of X-rays (EDAX, sometimes called EDS) would be the best way to confirm the presence of nitrogen in your carbonized MOFs. Most SEMs and TEMs have EDAX capabilities.
Depending on your starting MOF, it is actually possible to co-dope your carbons. For example, if you started with a cobalt ZIF then your carbonization product will be a Co,N-codoped carbon. Again, XPS and EDAX would be great for qualitative and quantitative analysis of both these dopants.
All what has said above is right. Photoelectron Spectroscopy (XPS) and Energy Dispersive Analysis of X-rays( EDX) techniques are better choices for confirm the chemical composition of heterostructured composite.
Depending on how much nitrogen is expected I would choose the technique. If the atomic percentage is > 10 at%, -->EDX. If between 10 and 0.5% then XPS and if lower than 0.5 at% I woluld choose a SIMS technique
If you are using ZIF-8 as your starting MOF, then this has the formula C8H12N4Zn as it is composed of two 2-methyl imidazole linkers (C4H6N2) and a zinc cation.
The nitrogen atom % = 100% x (the number of N atoms) / (the total number of atoms)
Thus for ZIF-8, the nitrogen atom % will be = 100% x 4 / 25 = 16.00%
When you carbonize, the hydrogen and some of the N will be lost. After carbonization, you typically dissolve out the Zn with HCl. After these steps, the composition of your sample will be C8Nx (where x is variable but is typically around 1/20 of the total amount of carbon in the product, giving the formula C8N0.4).
Thus, the nitrogen atom% in your product will be 100% x 0.4 / 8.4 = 4.76%.
EDAX or XPS should be useful for the determination the N-doping level. You should also do the N determination on your starting MOF as proof that your methods are accurate, since the N/C ratio of your starting MOF is precisely known. This can also be independently verified by standard C,H,N elemental analysis.