Let $\Omega \subset \mathbb{R}^{n}$ be open and bounded and $u \in C^{2}(\Omega) \cap C(\bar{\Omega}).$
Let u be a solution of the following boundary value problem:
$\Delta u = u^3 - u$ $\hspace{3mm}$ in $\Omega$,
$u = \frac{1}{2}$ $\hspace{16mm}$ on $\partial \Omega$.
Show that $-1 \leq u \leq 1$ throughout $\Omega$.
Attempt:
We know that extrema (maxima and minima) exist, since $u \in C^{2}(\Omega) \cap C(\bar{\Omega})$ and $\bar{\Omega}, \partial \Omega$ are compact. Assume that there is a (local) maximum of u in $x \in \Omega$. Since $x \in \Omega$ is a (local) maximum of u, we know that $\Delta u(x) \leq 0$. So, then $u(x)^{3} - u(x) \leq 0$. So $u(x)(u(x)^{2} -1) \leq 0$. So $u(x) \leq 0$ and $u(x)^{2} > 1$ ór $u(x) > 0$ and $u(x)^{2} \leq 1$. So $u(x) < -1$ ór $0 < u(x) \leq 1$.
Assume that there is a (local) minimum of u in $y \in \Omega$. Since $y \in \Omega$ is a (local) minimum of u, we know that $\Delta u(y) \geq 0$. So, then $u(y)^{3} - u(y) \geq 0$. So $u(y)(u(y)^{2} -1) \geq 0$. So $u(y) \geq 0$ and $u(y)^{2} \geq 1$ ór $u(y) \leq 0$ and $u(y)^{2} \leq 1$. So $u(y) \geq 1$ ór $-1 \leq u(y) \leq 0$.
How to conclude now that $-1 \leq u \leq 1$ in $\Omega$? So how to derive that those other cases can´t hold. I think we somehow need to use that $u = \frac{1}{2}$ on the boundary $\partial \Omega$. But I don´t know why. I think we can´t apply the maximal principle here, since we don´t know if the function u is harmonic, subharmonic or superharmonic.
Maybe it is just logical thinking that we can not have that $u(x) < -1$ holds for the maximum and $u(y) \geq 1$ holds for the minimum. But then we didn´t use the boundary condition ($u = \frac{1}{2}$ on $\partial \Omega$) at all.
In ¨A priori estimate on this boundary value problem¨ someone asked almost the same question. But I don´t know how and what kind of weak maximum principle is needed then.
Let $y_m$ and $y_M$ be points in $\overline \Omega$ where $u$ attains the minimum and the maximum respectively. Since $u = 1/2$ on $\partial \Omega$, $u(y_m) \le 1/2 \le u(y_M)$.
Start with the maximum. From your argument, one has $$ u(y_M ) ^3 - u(y_M) \le 0, $$ since $u(y_M)>0$, this implies $u(y_M) \le 1$.
Now for the minimum, at $y_m$ we have $$ \tag{1} u(y_m)^3 - u(y_m) \ge 0.$$ Note $u(y_m)$ must be negative: if $u(y_m)\ge 0$, then $u(y_m)^3< u(y_m) $ since $u(y_m) <1$.
Thus $u(y_m)<0$ and (1) imply $u^2 (y_m) \le 1$ which means $u(y_m) \ge -1$. This finishes the proof.