Given a function E(x) which outputs 0 is x is even and 1 is x is odd, prove that this function is primitive recursive.
My attempt is as follows
$$ E(x) = x \mod 2$$
To show that any function is primitive recursive, it must be obtained by composition and recursion from the initial functions $s(x) = x + 1; n(x) = 0$ and $u_i^n(x_1,x_2 \ldots x_n) = x_i$
We know that $$ E(0) = 0 $$ $$ E(x+1) = (E(x) + 1) \mod 2 $$ By using induction -
$$ E(n) = n \mod 2$$ Let $n = 0$ $$ E(0) = 0$$ which is easily shown to be primitive recursive since it is an initial function of the $PRC$ class.
Assuming that this is true for $n = k$. $$E(k) = k \mod 2$$ Taking $ n = k+1 $ $$ E(k+1) = (E(k) + 1)\mod 2 $$
But at this point, I do not know how to proceed.