  This paper addresses to Nichtnegativstellens\"atze for definable functions in
o-minimal structures on $(\mathbb{R}, +, \cdot).$ Namely, let $f, g_1, \ldots,
g_l \colon \mathbb{R}^n \to \mathbb{R}$ be definable $C^p$-functions ($p \ge
2$) and assume that $f$ is non-negative on $S := \{x \in \mathbb{R}^n \ | \
g_1(x) \ge 0, \ldots, g_l(x) \ge 0 \}.$ Under some natural hypotheses on zeros
of $f$ in $S,$ we show that $f$ is expressible in the form $f = \phi_0 +
\sum_{i = 1}^l \phi_i g_i,$ where each $\phi_i$ is a sum of squares of
definable $C^{p - 2}$-functions. As a consequence, we derive global optimality
conditions which generalize the Karush--Kuhn--Tucker optimality conditions for
nonlinear optimization.
