Solution (source code)

= Solution

Suppose first that $|E|\geq3$. Complete invariance implies that every iterate maps $\widehat{\mathbb C}\setminus E$ into itself. Hence the family $\{f^n\}$ omits the same three points of $E$ on this open set. By <Montel theorem>,
$$
\widehat{\mathbb C}\setminus E\subseteq F(f),
$$
so
$$
\boxed{J(f)\subseteq E}.
$$

If $E$ consists of one or two points, complete invariance makes $f$ permute those points and makes every preimage of them remain in $E$. Some iterate fixes each point and is totally ramified there. In a local coordinate it therefore has the form $w\mapsto aw^m+O(w^{m+1})$ with $m\geq2$, so the point is superattracting for that iterate and belongs to the <Fatou set>. This proves the <completely invariant closed set of a rational map> dichotomy.