We maximise $f(w) = p\log(1 + (u-1)w) + (1-p)\log(1-w)$ over $w \in [0,1)$. Differentiating and setting $f'(w) = 0$ gives
\begin{align*}
\frac{p(u-1)}{1 + (u-1)w} - \frac{1-p}{1-w} = 0.
\end{align*}
Cross-multiplying and solving for $w$ yields the candidate $w^* = \frac{up - 1}{u - 1}$. When $up \leq 1$ the derivative $f'(0) = p(u-1) - (1-p) = up - 1 \leq 0$, so $f$ is non-increasing on $[0,1)$ and the maximum is at $w = 0$. When $up > 1$ we have $w^* > 0$, and one checks $w^* < 1$ since $up - 1 < u - 1$ (using $p < 1$), so the critical point lies in the interior $(0,1)$. Since $f$ is strictly concave on $[0,1)$ (both terms have negative second derivatives), this interior critical point is the unique global maximum.