Congratulations on the good report! Great A1c!
I hope the foot appointment helps figure out what's going on, too.
A couple of conditions (in your case, I think, but there are others) gave you high blood sugar: excess weight and diet (including lifestyle) both of which make you insulin resistant. I'm just recounting this even though you already know it. Your pancreas is still making insulin - good. The excess weight makes the body more insulin resistant though - bad. When this happens, our blood sugar rises and we gain more weight. Our body doesn't use the blood sugar for energy as it's supposed to because it can't = we are insulin resistant. Cutting down (or out) all those carbs and getting more physically active helps the body use the blood sugar effectively as it's supposed to and one of the results is losing weight in addition to lower blood sugar. Sometimes this can be done without meds, sometimes not.
The metformin helps the body's cells 'open up' to receive the blood glucose for energy as it's supposed to do. If you stop taking the metformin, you may see your blood sugar rise over time even if you keep your same diet and exercise. So, please be careful about monitoring your blood sugar. I think you already know what foods are going to raise your blood sugar and this will happen even while taking the metformin.
Good luck with the foot appointment.