I was wondering whether it is possible to generalise the statement of this post, i.e. I would like to show something like $$\|f\|^2_{L^2(\Omega)}\leq C \|\nabla f\|^2_{L^2(\Omega)},$$ where $\Omega=[0,1]^n$ and $f:\Omega\to\mathbb{R}$ is a suitable function with $f=0$ on the vertices of $\Omega$ (and $C$ does not depend of $f$). Although this seems to be a standard question I was not able to find anything on this for $n\geq2$.
My approach was the following (given that everything is well-defined). By $f(0)=0$ we know that: $$f(x)=\int^1_0\langle\nabla f(hx),x\rangle dh=\int^{|x|}_0\langle\nabla f(uw),w\rangle du,$$ where $w=x/|x|$. If I am not mistaken, using polar coordinates (cf. this post) should give the identity $$\|f\|^2_{L^2(\Omega)}=\int^{\rho_n}_0\int_{A_n}f(rw)^2dwr^{n-1}dr$$ with $A_n=S^{n-1}\cap[0,1]^n$, $S^{n-1}$ sphere and $\rho_n=\sqrt{n}$ being the "diagonal" (or diameter) of $\Omega$. Next I would like to combine the two preceding equalities to obtain the desired inequality. This should give (if I did not mix anything up with the gradient) the equation $$\|f\|^2_{L^2(\Omega)}=\int^{\rho_n}_0\int_{A_n}\Big(\int^r_0\langle\nabla f(uw),w\rangle du\Big)^2dwr^{n-1}dr.$$ Cauchy-Schwarz now yields $$\|f\|^2_{L^2(\Omega)}\leq\int^{\rho_n}_0\int_{A_n}\int^r_0|\nabla f(uw)|^2dudwr^ndr$$ but I do not see how I could end up with $\|\nabla f\|^2_{L^2(\Omega)}$ since I would need the term $u^{n-1}$ to pop-up somewhere.
Any ideas are appreciated especially for the special case $n=2$. In particular, I would like to consider Sobolev functions with $s\in(1,2)$ to obtain $$\|f\|^2_{L^2(\Omega)}\leq C \|\nabla f\|^2_{L^2(\Omega)}\leq C' \sum_{|\alpha|=1}\| f^{(\alpha)}\|^2_{H^{s-1}(\Omega)},$$ such that $C'$ does not depend on $f$ and I think that I already showed that the second inequality holds.