Let $Q := (-1/2,1/2)^2 \subset \mathbb{R}^2$ be the unit cube with center at the origin. Is it true that there exists a constant $c > 0$ such that for all $f \in \mathcal{C}^\infty(Q)$ $$ \tag{1} \lvert f(0) \rvert \leq c \cdot \left( \lVert f \rVert_{L^2(Q)}^2 + \lVert \nabla f \rVert_{L^2(Q)}^2 \right)^{1/2} $$ holds? If it is true, how can one prove it and what can be the value of the constant? If it is not true, what is the counterexample which shows that it is not true?
I have tried to approach these questions in two ways: First, by noting its similarity to Sobolev inequalities. Secondly, by using the fundamental theorem of calculus.
Sobolev inequalities
Inequality $(1)$ does look a lot like a Sobolev inequality. The right-hand side is (forgetting about the constant $c$) $$ \left( \lVert f \rVert_{L^2(Q)}^2 + \lVert \nabla f \rVert_{L^2(Q)}^2 \right)^{1/2} = \lVert f \rVert_{H^1(Q)}. $$ The left-hand side seems related to the $L^\infty$-norm. Therefore, inequality $(1)$ seems to be a Sobolev inequality between $L^\infty(Q)$ and $H^1(Q)$. If $Q$ were a (one-dimensional) bounded interval, then the estimate should thus be true (cf. Theorem 0.1 on p. 1 of https://www-users.cse.umn.edu/~garrett/m/fun/notes_2016-17/03a_intro_blevi.pdf) if I am not mistaken. Since $Q$ is two-dimensional however, I think that $H^1(Q)$ does not embed into $\mathcal{C}(Q)$ (cf. Discontinuous Sobolev Function). Therefore, I would conjecture that inequality $(1)$ is false. The examples typically used to show that there exist functions in $H^1$ which are discontinuous have however not really helped me in finding a smooth function which violates inequality $(1)$.
The fundamental theorem of calculus
Except for my failure in finding a counterexample to inequality $(1)$, I have also tried to prove inequality $(1)$ using the fundamental theorem of calculus. My unfinished argument is as follows: According to the fundamental theorem of calculus, we have that $$ f(\mathbf{x}) = f(\boldsymbol{0}) + \int_0^1 \left\langle \nabla f (t\mathbf{x}), \mathbf{x} \right\rangle \,\mathrm{d} t, \qquad \mathbf{x} \in Q. $$ It follows that $$ \tag{2} \lvert f(\boldsymbol{0}) \rvert^2 \leq 2 \lvert f(\mathbf{x}) \rvert^2 + 2 \left\lvert \int_0^1 \left\langle \nabla f (t\mathbf{x}), \mathbf{x} \right\rangle \,\mathrm{d} t \right\rvert^2 \leq 2 \lvert f(\mathbf{x}) \rvert^2 + 2 \cdot \int_0^1 \left\lvert \left\langle \nabla f (t\mathbf{x}), \mathbf{x} \right\rangle \right\rvert^2 \,\mathrm{d} t, $$ where we have used the triangle inequality and Jensen's inequality twice. By the Cauchy-Schwarz inequality, we find that $$ 2 \int_0^1 \left\lvert \left\langle \nabla f (t\mathbf{x}), \mathbf{x} \right\rangle \right\rvert^2 \,\mathrm{d} t \leq 2 \left\lVert \mathbf{x} \right\rVert_2^2 \cdot \int_0^1 \left\lVert \nabla f (t\mathbf{x}) \right\rVert_2^2 \,\mathrm{d} t \leq \int_0^1 \left\lVert \nabla f (t\mathbf{x}) \right\rVert_2^2 \,\mathrm{d} t, $$ for $\mathbf{x} \in Q$. We may now integrate inequality $(2)$ over $Q$ and use that $Q$ has volume one to find that $$ \lvert f(\boldsymbol{0}) \rvert^2 \leq 2 \lVert f \rVert_{L^2(Q)}^2 + \int_Q \int_0^1 \left\lVert \nabla f (t\mathbf{x}) \right\rVert_2^2 \,\mathrm{d} t \, \mathrm{d} \mathbf{x} = 2 \lVert f \rVert_{L^2(Q)}^2 + \int_0^1 \int_Q \left\lVert \nabla f (t\mathbf{x}) \right\rVert_2^2 \, \mathrm{d} \mathbf{x} \,\mathrm{d} t. $$ It seems like we are almost done at this point. However, I cannot seem to finish the argument. I would proceed as follows: By a substitution, we find that $$ \int_0^1 \int_Q \left\lVert \nabla f (t\mathbf{x}) \right\rVert_2^2 \, \mathrm{d} \mathbf{x} \,\mathrm{d} t = \int_0^1 \int_{tQ} \frac{\left\lVert \nabla f (\mathbf{y}) \right\rVert_2^2}{t} \, \mathrm{d} \mathbf{y} \,\mathrm{d} t = \int_0^1 \frac{\left\lVert \nabla f \right\rVert_{L^2(tQ)}^2}{t} \,\mathrm{d} t \leq \int_0^1 \frac{\mathrm{d} t}{t} \cdot \left\lVert \nabla f \right\rVert_{L^2(Q)}^2, $$ where we used that $tQ \subset Q$, for $t \in (0,1)$. Unfortunately, the integral over $1/t$ does not converge and thus we cannot conclude.