This paper contains three parts. In the first part, we determine the best constant of an improved inequality of Gagliardo-Nirenberg interpolation (Chen, in Czechoslov Math J, in press). In the second part, we use this best constant to establish a sharp criterion for the global existence and blow-up of solutions of the inhomogeneous nonlinear Schrödinger equation with harmonic potentialin the critical nonlinearity p = 1 + (4 + 2b)/N . In the third part, we use this best constant to construct an unbounded subset S of and prove that the solutions exist globally in time for ϕ 0 ∈ S and p > 1 + (4 + 2b)/N .