If canning, prepare a water bath canner, jars and lids before beginning. If not canning, no worries, just let it cool on the counter in jars before storing in the refrigerator.
Heat oil in a heavy-bottomed pan or Dutch oven over medium-high heat, then add the sliced onions and stir to coat.
Reduce the heat to medium and cook the onions for 45-50 minutes, stirring often.
Prepare jars and a hot water bath.
Add maple sugar to the cooked onions and stir to dissolve the sugar.
Increase the heat to medium-high and cook the onions and sugar for 3-4 minutes, stirring constantly.
Carefully stir in the vinegar and lemon juice, being cautious of splattering and vinegar vapor.
Reduce the heat to medium and add salt to the mixture.
Cook the onion mixture until the vinegar has reduced to a sticky syrup, about 10-12 minutes.
Pour or ladle the hot jam into prepared hot jars, leaving ½ " headspace at the top of the jars.
Wipe the rims of the jars with a clean cloth, and apply the 2-part canning lids.
Preserve the homemade onion jam using a hot water bath canning method for 10 minutes, adjusting time if necessary for altitude.
After processing, turn off the heat and leave jars in the canner, uncovered, for 5 minutes. Remove the jars from the canner and let them cool for 12-24 hours, then check that the jars have sealed. Refrigerate any unsealed jars.
Sealed red onion jam will retain peak quality for up to 18 months stored in a cool, dry place or pantry. Refrigerate the jam once opened.