I have heard that if you keep a mustahab fast and if someone offers you food it is mustahab to break the fast and eat with them. Then I heard you can continue the fast. So I wanted to know the conditions under which one can continue fasting.

If momin offers you food while you are observing mustahab fast then accept it inshallah you will be rewarded for fasting and momin will be rewarded for providing iftar. No you are not allowed to continue .