Suppose by absurd that the characteristic of an integral domain is an integer $n$ not prime, say $n=n_1 \cdot n_2$.
Now we have $$na=(n_1 \cdot n_2)a=0 \implies (n_1 \cdot a) \cdot (n_2 \cdot a)=0 \implies n_1 \cdot a=0 \space \lor n_2 \cdot a=0$$
In my book it is considered a contradiction (for the minimality of $n$) but a priori it could be possible that $n_1$ and $n_2$ don't satisfy characteristic property.
Adopted definition of characteristic of an integral domain (with $charD \neq 0$):
$$charD := min \{n \in \mathbb{N}| \space n \cdot a=0 \space \forall a \in D\}$$
In my book an integral domain is a commutative ring without non-zero zero divisors. I do not assume identity.