Inserted: 7 sep 2019
Last Updated: 19 may 2021
Journal: accepted on C.P.A.M.
Some corrections made in Section 4.
We consider the problem of prescribing conformally the scalar curvature on compact manifolds of positive Yamabe class in dimension $n \geq 5$. We prove new existence results using Morse theory and some analysis on blowing-up solutions, under suitable pinching conditions on the curvature function. We also provide new non-existence results showing the sharpness of some of our assumptions, both in terms of the dimension and of the Morse structure of the prescribed function.