Let $I = (0,L)$.
i) There exists $C>0$, such that for all $g\in C((0,L))$ with $\int_{0}^{L}g=0$, the solution u of the Heat Equation
\begin{eqnarray} u_t=u_{xx} \; \;\;\;\;\;in\; I \times (0,\infty)\\ u = g \;\;\;\;\;\;\;\;\;\;\; on\; I \times \{t=0\}\\ u_x(0,t)=u_x(L,t)=0 \;\;\;\;\; t>0 \end{eqnarray} satisfies the following inequality \begin{eqnarray} \int_{0}^{L}u(x,t)^2dx\leq e^{-Ct} \int_{0}^{L}g(x)^2dx \end{eqnarray}
ii) Let $Q_T=I \times (0,T]$ for $T>0$. Let $a,b,c\in C^\infty(Q_T)$ with $a(x,t)\geq0$ and $c(x,t)\leq0$ for all $(x,t)\in Q_T$. The function $w \in C^\infty(Q_T)$ satisfies the differential equation \begin{eqnarray} w_t - aw_{xx} - bw_x - cw < 0, \; \;\;\;\; in \;\; Q_T. \end{eqnarray}
Show that $w$ doesn't have a local positive Maximum in $Q_T$.
It would be very helpful if anyone could help me with a solution or an idea!
$(1)$ Let's show a counterexample. Consider the function $g(x):=x-\tfrac{L}{2}$ which is clearly continuous and satisfies $$ \int_0^Lg(x)dx=\dfrac{L^2}{2}-\dfrac{L^2}{2}=0. $$ Now, consider the time-independent function $u(t,x)=g(x)$. Note that this function solves the heat equation. In fact, $$ u_t(t,x)=\dfrac{d}{dt}g(x)=0, \qquad u_{xx}(t,x)=\dfrac{d^2}{dx^2}g(x)=0. $$ Moreover, it satisfies all the boundary condition:$$ \forall t\in\mathbb{R}, \ \, u_x(0,t)=1, \ u_x(L,t)=1, \quad \hbox{ and } \quad \forall x\in (0,L), \ \, u(x,0)=g(x). $$ Nevertheless, this solution satisfies the following property $$ \int_0^L u(t,x)^2dx=\int_0^Lg(x)^2dx, \qquad \forall t\in\mathbb{R} $$ Thus, there cannot exists any constant $C>0$ such that $$ \int_0^Lu^2(t,x)dx\leq e^{-Ct}\int_0^Lg(x)^2dx, $$ because the right-hand side is going to zero as $t\to\infty$.
For your second question, you have to go by contradiction. Assume that you have a function satisfying the differential inequality which reaches a local maximum at some point $(x^\star,t^\star)\in Q_T$. Since $w$ is smooth in $Q_T$, we have $$ w_t(x^\star,t^\star)=w_x(x^\star,t^\star)=0. $$ Then, what can I say about the sign of $w_{xx}(x^\star,t^\star)$? I let you finish this exercise. Once you deduce the sign of $w_{xx}(x^\star,t^\star)$ you can use this information to get a contradiction with you initial inequality.
For your edited question: multiplying the PDE by $u(t,x)$ and integrating in $x\in (0,L)$ we obtain $$ \dfrac{d}{dt}\dfrac{1}{2}\int_0^Lu^2(t,x)dx=\int_0^Lu_{xx}(t,x)u(t,x)dx=-\int_0^L u_x^2(t,x)dx \qquad (*) $$ On the other hand, note that integrating directly in the PDE we have $$ \dfrac{d}{dt}\int u(t,x)dx=\int u_{xx}(t,x)dx=u_x(t,L)-u_x(t,0)=0, $$ and hence, integrating in time we obtain $$ \int_0^L u(t,x)dx=\int_0^L u(0,x)dx=\int_0^L g(x)dx=0, \quad \forall t\in\mathbb{R}. $$ Now, it is easy to finish using the solution you are refering in the comments (I saw you modificate the question after you comment that). Since our solution has zero mean for all times, it satisfies the hypothesis of the Wirtinger Theorem for all $t\in\mathbb{R}$. Thus, by Wirtinger's Theorem we have $$ \int_0^L u^2(t,x)dx\leq C\int_0^Lu_x^2(t,x)dx, \quad \forall t\in\mathbb{R}, $$ where $C>0$ is a positive constant only depending on $L$ (due to the change of scale when using Wirtinger's Theorem in $(0,L)$ instead of $(0,2\pi)$). Plugging this in $(*)$ we obtain $$ \dfrac{d}{dt}\dfrac{1}{2}\int_0^L u^2(t,x)dx= -\int_0^L u_x^2(t,x)dx\leq-C\int_0^L u^2(t,x)dx, \quad \forall t\in\mathbb{R}. $$ Thus, multiplying both sides of the inequality by $2e^{2Ct}>0$ we obtain $$ \dfrac{d}{dt}\left(e^{2Ct}\int_0^L u^2(t,x)dx\right)\leq 0. $$ Finally, integrating in time from $0$ to $t$ we conlcude $$ e^{2Ct}\int_0^L u^2(t,x)dx\leq\int_0^Lu^2(0,x)dx \ \implies \ \int_0^L u^2(t,x)dx\leq e^{-2Ct}\int_0^Lg^2(x)dx. $$ So the proof is complete. Please let me know if you modify the question, MSE does not notify people when you modify your questions, even if I already answered.
Second edit: Please note that, in order to use Wirtinger's Theorem, it is important to prove that $$ \int_0^L u(t,x)dx=0 $$ for all times $t\in\mathbb{R}$ (which is not proved in the post you referred in the comments). Otherwise, $u(t,x)$ only satisfy the hypothesis of the theorem at the initial time, which is not enough to ensure $$ \int_0^L u^2(t,x)dx\leq\int_0^Lu_x^2(t,x)dx. $$