1. An image forming apparatus comprising: a predicting unit that predicts a prediction lifetime of a consumable that is detachably mounted in the image forming apparatus, based on consumption information corresponding to an operation of the image forming apparatus; a connection determining unit that determines whether or not the image forming apparatus is connected to a managing apparatus that manages a replacement time of the consumable that is detachably mounted in the image forming apparatus; a consumption information transmitting unit that transmits the consumption information to the managing apparatus located outside the image forming apparatus; a managed lifetime information receiving unit that receives managed lifetime information transmitted from the managing apparatus based on the consumption information; a replacement time determining unit that determines whether or not the replacement time of the consumable has been reached; a learning unit that effects a learning of the prediction lifetime based on the predicted prediction lifetime predicted by the predicting unit and the replacement time determined by the replacement time determining unit; and a prediction lifetime updating unit that, in a case where the image forming apparatus is connected to the managing apparatus, updates the prediction lifetime of the consumable based on the managed lifetime information, and that, in a case where the image forming apparatus is not connected to the managing apparatus, updates the prediction lifetime of the consumable based on the predicted prediction lifetime learned by the learning unit.