I've written the question out on MathB.in for simplicity: Flawed Reasoning - MathB.in
My gut feeling is that the answer is to do with the open interval in the hypothesis of the mean value theorem, but I'm not sure.
All derivatives, while possibly incredibly discontinuous, are Darboux continuous (which means they possess the Intermediate Value Property). Hence, the two results are not contradictory. What you are missing is that is dependent upon . So, the correct formula would be . That does not imply that is continuous at . On the LHS, you have a composition of functions. On the RHS, you do not.
That is obvious that does not need to be continuous. The MVT guarantees the EXISTENCE of such a , it does not give a limit for the NUMBER of such values. For a chosen , there are, in fact, an infinite number of such values for that will satisfy the MVT. It is almost guaranteed that function will be discontinuous.
Consider the topology of the space of all points where are all possible values of that satisfy the MVT for the specific . If , this is a subset of . That might give you an idea of the nature of a chosen function .