In this paper we study the Nirenberg problem on standard half spheres (mathbb {S}^n_+,g), , n ge 5, which consists of finding conformal metrics of prescribed scalar curvature and zero boundary mean curvature on the boundary. This problem amounts to solve the following boundary value problem involving the critical Sobolev exponent: (P)-Δgu+n(n-2)4u=Kun+2n-2,u>0inS+n,∂u∂ν=0on∂S+n.\\documentclass[12pt]{minimal}\t\t\t\t\\usepackage{amsmath}\t\t\t\t\\usepackage{wasysym}\t\t\t\t\\usepackage{amsfonts}\t\t\t\t\\usepackage{amssymb}\t\t\t\t\\usepackage{amsbsy}\t\t\t\t\\usepackage{mathrsfs}\t\t\t\t\\usepackage{upgreek}\t\t\t\t\\setlength{\\oddsidemargin}{-69pt}\t\t\t\t\\begin{document}$$\\begin{aligned} (\\mathcal {P}) \\quad {\\left\\{ \\begin{array}{ll} -\\Delta _{g} u \\, + \\, \\frac{n(n-2)}{4} u \\, = K \\, u^{\\frac{n+2}{n-2}},\\, u > 0 &{}\\quad \\text{ in } \\mathbb {S}^n_+, \\\\ \\frac{\\partial u}{\\partial \\nu }\\, =\\, 0 &{}\\quad \\text{ on } \\partial \\mathbb {S}^n_+. \\end{array}\\right. } \\end{aligned}$$\\end{document}where K in C^3(mathbb {S}^n_+) is a positive function. This problem has a variational structure but the related Euler–Lagrange functional J_K lacks compactness. Indeed it admits critical points at infinity, which are limits of non compact orbits of the (negative) gradient flow. Through the construction of an appropriate pseudogradient in the neighborhood at infinity, we characterize these critical points at infinity, associate to them an index, perform a Morse type reduction of the functional J_K in their neighborhood and compute their contribution to the difference of topology between the level sets of J_K, hence extending the full Morse theoretical approach to this non compact variational problem. Such an approach is used to prove, under various pinching conditions, some existence results for (mathcal {P}) on half spheres of dimension n ge 5.