WHATdefinition? You are spend a lot of time saying you need to have a "careful definition of what is meant by 'local maximum' and 'local minimum'" but you don't say what definitions you want to use. The usual are "a function, f(x), has a 'local maximum' at if and only if there exist a neighborhood of such that with x in that neighborhood and similarly, with the inequality reversed, for 'local minimum'.