In the below text, I don't see why the red boxed equation satisfies a definition by primitive recursion.
In this case, the definition says: $ \ \ g(0)=f(n)=0$, $ \ \ $ $g(n+1) = h(n,g(n))$.
I can see what $f$ should be, but what is the function $h$ here?
It seems to be some composition involving the $add$ function, but I don't see how to 'turn' $\chi_{E}(\text{succ}(n)) \ $ into $n$, if that makes sense... Thanks.
EDIT: $E$ is the set of even natural numbers.

Just use
$$h(n,a) = a + \chi_E(\mathrm{succ}(n)) = \mathrm{add}(P^2_1(a,n), \chi_E(\mathrm{succ}(P^2_2(a,n))),$$
where $P^n_i$ is a projection function, which is considered primitive recursive by default.
Then plugging $a = g(n)$ into $h$ gives you recursion step:
$$ h(n,g(n)) = g(n) + \chi_E(\mathrm{succ}(n)) = g(n + 1) $$