Show that the carré du champ operator is nonnegative

First of all note that for any $g \in L^2(\mu)$ we have

$$(\kappa_t g)^2 \leq \kappa_t(g^2) \quad \text{$\mu$-almost everywhere}\tag{1}$$

where the exceptional null set may depend on $t \geq 0$ and $g$; this follows by a standard approximation procedure, see @MaoWao's answer for details.


Now let $f \in D(A)$ be such that $f^2 \in D(A)$. Set $t_n := 1/n$ for $n \in \mathbb{N}$. Because of $(1)$ there exists a $\mu$-null set $N_0$ such that

$$(\kappa_{t_n}f)^2(x)\leq \kappa_{t_n} (f^2)(x) \quad \text{for all $x \in E \backslash N_0$, $n \in \mathbb{N}$}$$

i.e.

$$\frac{1}{t_n} \big[ \kappa_{t_n} (f^2)(x)-f(x)^2 \big] -\frac{1}{t_n} \big[ (\kappa_{t_n} f)^2(x) -f(x)^2 \big] \geq 0 \quad \text{for all $x \in E \backslash N_0$, $n \in \mathbb{N}$.} \tag{2}$$

Since $f \in D(A)$ we have $Af = \lim_{t \to 0} t^{-1} (\kappa_tf-f)$ in $L^2(\mu)$; in particular, we can choose a subsequence $(t_n')$ of $(t_n)$ such that

$$Af(x) = \lim_{n \to \infty} \frac{\kappa_{t_n'}f(x)-f(x)}{t_n'}, \quad x \in E \backslash N_1 \tag{3}$$ for a $\mu$-null set $N_1$.Note that this implies in particular

$$\kappa_{t_n'} f(x) \xrightarrow[]{n \to \infty} f(x), \qquad x \in E \backslash N_1. \tag{4}$$ Similarly, $f^2 \in D(A)$ implies that there exists a $\mu$-null set $N_2$ and a further subsequence $(t_n'')$ of $(t_n')$ such that

$$A(f^2)(x) = \lim_{n \to \infty} \frac{\kappa_{t_n''}(f^2)(x)-f^2(x)}{t_n''}, \quad x \in E \backslash N_2. \tag{5}$$

Clearly, $(2)$-$(4)$ remain valid with $t_n$ (resp. $t_n'$) replaced by $t_n''$. Set $N := N_0 \cup N_1 \cup N_2$ and fix $x \in E \backslash N$. Writing

$$(\kappa_{t_n''} f)^2(x) -f(x)^2 = (\kappa_{t_n''} f(x)+f(x)) (\kappa_{t_n''}f(x)-f(x))$$

and dividing both sides by $t_n''$ it follows from $(3)$ and $(4)$ that

$$\frac{(\kappa_{t_n''} f)^2(x) -f(x)^2}{t_n''} \to 2f(x) Af(x). \tag{6}$$

Using $(2)$ (for $t_n''$) and letting $n \to \infty$ it now follows from $(5)$ and $(6)$ that

$$A(f^2)(x)-2f(x) Af(x) \geq 0.$$

We have shown this identity for any $x \in E \backslash N$ and since $N$ is a $\mu$-null set this proves the assertion.