If $f'$ exists we have already proved that if $f'(x_0)=0$ then $x_0$ is a point of maximum/minimum, if $f'$ doesn't exist we have done because it was one of the possibilities. However, it seems like that in general I can only write $\bar{A}=int(A) \cup \partial A$ and so I am probably wrong in my argument of considering $A=int(A) \cup \partial A$. Why my lecturer said that there are only those three possibilities where $x_0$ belongs?