The temperature of a substance remain constant at its boiling and melting points because at that particular temperature the amount of external heat which is being supplied to the substance is used to break the inter molecular forces so the temperature remains constant until the state of matter changes the heat is used to break inter molecular forces and hence after the breaking of inter molecular forces temperature rises again.