It is not permissible for one who has started an obligatory fast to break it without a legitimate shar’i reason
Question

                If a person intends to make up a missed fast and is invited to eat when visiting some relatives, and he eats, is there any sin on him and does he have to repeat the day, so long as he intended to fast?.
Praise be to Allah.
    If a person starts to observe an obligatory fast, it is 
    haraam for him to break it without any reason. If he breaks it he has to 
    make up this day. Ibn Muflih said in al-Furoo’: 

    It is haraam to break an obligatory fast. 

    Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) was 
    asked in Fataawa al-Sawm (p. 452) about a woman who was making up a 
    missed fast, then some guests arrived at her house and in order to join them 
    she broke her fast – is that permissible? 

    He replied: 

    If she was making up a missed obligatory fast, such as making 
    up missed days from Ramadaan, then it is not permissible for anyone to break 
    such a fast except in cases of necessity. With regard to breaking the fast 
    because of the arrival of guests, this is haraam and is not permissible, 
    because the basic principle of sharee’ah is that anyone who starts an 
    obligatory action must complete it, unless he has a legitimate shar’i excuse 
    (for not doing so). 

    But if he is making up a naafil fast, then he does not have 
    to complete it, because it is not obligatory. 

    He also said in Fataawa al-Siyaam (p. 451): 
If a person starts an 
    obligatory fast, such as making up a day missed in Ramadaan or kafaarat 
    yameen (expiation for breaking a vow) or expiation for shaving during Hajj – 
    if the pilgrim shaved his head before exiting ihraam – and other kinds of 
    obligatory fasts, it is not permissible for him to break it except for a 
    legitimate shar’i reason. The same applies if he starts any obligatory 
    action – he is obliged to complete it and it is not permissible for him to 
    stop it except for a legitimate shar’i reason that allows him to do so.