First of all, thank you for your reply. Next, you're right, I forgot an hypothesis that could be crucial: f(p)\to -\infty as p approaches the boundary \partial M. Could this do any difference?
Maybe, (but I don't know if this makes any sense...) an idea could be to work with the extended...