The bold in the following sentence is where I am confused - is it punctuated properly?
It will be necessary to either return this money to the government if possible or, if not, give it to the poor without the intention of gaining reward."
It is. The commas in this passage serve to set off the appositive phrase, “if not.” For more information https://owl.purdue.edu/owl/general_writing/grammar/appositives.html