In this paper we study the Nirenberg problem on standard half spheres $$(\mathbb {S}^n_+,g), \, n \ge 5$$
(
S
+
n
,
g
)
,
n
≥
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: $$\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}$$
(
P
)
-
Δ
g
u
+
n
(
n
-
2
)
4
u
=
K
u
n
+
2
n
-
2
,
u
>
0
in
S
+
n
,
∂
u
∂
ν
=
0
on
∂
S
+
n
.
where $$K \in C^3(\mathbb {S}^n_+)$$
K
∈
C
3
(
S
+
n
)
is a positive function. This problem has a variational structure but the related Euler–Lagrange functional $$J_K$$
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$$
J
K
in their neighborhood and compute their contribution to the difference of topology between the level sets of $$J_K$$
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})$$
(
P
)
on half spheres of dimension $$n \ge 5$$
n
≥
5
.