inflection and maximum point of y=cosx

what, you have forgotten your 1st and 2nd derivative checks? And geez, this is one of your basic trig functions. You already know where the max/min/inflections are, so it's easy to check your answers.

y = cosx
y' = -sinx
y" = -cosx

y'=0 at all multiples of π. Nut then, you already knew that cosx achieves its max/min there, right?

y"=0 at odd multiples of π/2. But then, you already know that the inflection points were halfway between the extrema, right?

y"<0 at x = 0, so that's a max
y">0 at x=π, so that's a min

Don't forget what you have already learned; it can help making calculus problems easier to solve!