Let $\Omega\subset \mathbb{R}^n$ open and bounded. The Poincaré inequality
$$\|u\|\_p \le C \|\nabla u\|\_p$$
($\|\cdot\|\_p$ denotes the usual $L^p(\Omega)$-norm; the Lebesgue measure shall be used here)
is valid in the following cases:


* $u$ is zero on $\partial\Omega$ (in the $W^{1,p}$-sense)
* $u$ has an average value of zero (this implies an estimate of $\|u-\bar u\|\_p$, but not of $\|u\|\_p$ for general $u$)
* $\mu := |\{u=0\}| > 0$ (Lebesgue measure), with a constant that blows up as $\mu\to 0$.


Of course the inequality cannot hold in general (take $u$ to be a constant function), but the only obstruction seems to be that $u$ can be far away from zero. Therefore it should be true that the inequality holds whenever $u$ is zero somewhere in $\Omega$ (in a suitable sense, for example, zero is contained in the essential range of $u$).


So the question is: Is there a version of the inequality for this case?



Version of the Poincaré Inequality
The Poincaré inequality need not hold in this case. The region where the function is near zero might be too small to force the integral of the gradient to be large enough to control the integral of the function.


For an explicit counterexample, let $$\Omega = \{(x,y) \in \mathbb{R}^2 : 0 < x < 1, 0 < y < x^2\}$$ be the region under the graph of a parabola, and take $p=2$. For $\epsilon > 0$, let $$u\_\epsilon(x,y) = \begin{cases} x/\epsilon, & x < \epsilon \\\ 1, & x \ge \epsilon \end{cases}.$$ $0$ is in the essential range of each $u\_\epsilon$, but one can easily verify $||\nabla u\_\epsilon||\_2^2 = \epsilon/3 \to 0$ as $\epsilon \to 0$, whereas $||u\_\epsilon||\_2^2 \to |\Omega| = 1/3$. 


**Edit:** To address Piero's comment, the irregularity of the domain is not the main issue here. For another counterexample, let $\Omega$ be the unit ball in $\mathbb{R}^d$, $d \ge 3$, and take
$$u\_\epsilon(x) = \begin{cases} \frac{|x|^2}{\epsilon^2}, & |x| < \epsilon \\\ 1, & |x| \ge \epsilon \end{cases}.$$ Using polar coordinates, one easily computes $||\nabla u\_\epsilon||\_2^2 \sim \epsilon^{d-2}$ while again $||u\_\epsilon||\_2^2 \to |\Omega|$.


What's really the problem is that the set where $u$ vanishes has zero capacity. If you can control from below the capacity of the set where $u$ vanishes, then you can get a Poincaré inequality.


Indeed, the following theorem may be what the asker wants: for "reasonable" $\Omega$ (Lipschitz suffices), if $\mathrm{Cap}(\{u = 0\}) \ge \delta$, then $||u||\_2^2 \le \frac{C}{\delta} ||\nabla u||\_2^2$. The precise statement (for any value of $p$) can be found in section 4.5 of William P. Ziemer's *Weakly Differentiable Functions* (along with the definition of capacity).


Note in particular that $\mathrm{Cap}(E) \ge m(E)$, so it's enough to control the Lebesgue measure. This is your bullet point 3.


