[guided]The goal of this step is to turn the failure of being a.e. constant into an actual measurable set of probability strictly between $0$ and $1$. Since $f$ is complex-valued, we first reduce to a real-valued function. Define
\begin{align*}
u:E&\to\mathbb R
\end{align*}
by $u(x)=\operatorname{Re}(f(x))$ and define
\begin{align*}
v:E&\to\mathbb R
\end{align*}
by $v(x)=\operatorname{Im}(f(x))$. Both maps are $\mathcal E/\mathcal B(\mathbb R)$-measurable because the real and imaginary part maps $\mathbb C\to\mathbb R$ are $\mathcal B(\mathbb C)/\mathcal B(\mathbb R)$-measurable and $f$ is $\mathcal E/\mathcal B(\mathbb C)$-measurable.
If both $u$ and $v$ were equal to constants a.e., say $u=c_1$ a.e. and $v=c_2$ a.e., then $f=c_1+ic_2$ a.e. This is excluded. Hence one of $u$ and $v$ is not equal to a constant a.e.; call that real-valued measurable function $g:E\to\mathbb R$.
We now show that some strict sublevel set of $g$ has intermediate probability. Suppose the contrary: for every $t\in\mathbb R$, the set $\{x\in E:g(x)<t\}$ has probability either $0$ or $1$. Define
\begin{align*}
a:=\sup\{q\in\mathbb Q:\mathbb P(\{x\in E:g(x)<q\})=0\}.
\end{align*}
The use of rational numbers is important because it lets us take countable unions, so countable additivity applies.
Let
\begin{align*}
S:=\{q\in\mathbb Q:\mathbb P(\{x\in E:g(x)<q\})=0\}.
\end{align*}
The set $S$ is neither empty nor all of $\mathbb Q$. If $S$ were empty, then $\mathbb P(\{g<q\})=1$ for every rational $q$. Taking the countable intersection over $q\in\mathbb Q$, the set
\begin{align*}
\bigcap_{q\in\mathbb Q}\{x\in E:g(x)<q\}
\end{align*}
would have probability $1$. But this intersection is empty: for each $x\in E$, the real number $g(x)$ is larger than some rational number. If $S=\mathbb Q$, then $\mathbb P(\{g<q\})=0$ for every rational $q$, so $\mathbb P(\{g\ge q\})=1$ for every rational $q$. Taking the countable intersection over $q\in\mathbb Q$, the set
\begin{align*}
\bigcap_{q\in\mathbb Q}\{x\in E:g(x)\ge q\}
\end{align*}
would have probability $1$. But this intersection is empty: for each $x\in E$, the real number $g(x)$ is smaller than some rational number. Thus $a=\sup S$ is a real number.
Let $q\in\mathbb Q$ satisfy $q<a$. The supremum property gives some $r\in S$ with $q<r\le a$; otherwise $q$ would be an upper bound for $S$, contradicting $q<a=\sup S$. Since $r\in S$, we have $\mathbb P(\{g<r\})=0$, and monotonicity of measure applied to $\{g<q\}\subset\{g<r\}$ gives
\begin{align*}
\mathbb P(\{g<q\})=0.
\end{align*}
Since
\begin{align*}
\{g<a\}=\bigcup_{\substack{q\in\mathbb Q, q<a}}\{g<q\},
\end{align*}
[countable subadditivity](/theorems/1108) gives
\begin{align*}
\mathbb P(\{g<a\})=0.
\end{align*}
For every rational $q>a$, the definition of $a$ gives
\begin{align*}
\mathbb P(\{g<q\})=1,
\end{align*}
and therefore
\begin{align*}
\mathbb P(\{g\ge q\})=0.
\end{align*}
Since
\begin{align*}
\{g>a\}=\bigcup_{\substack{q\in\mathbb Q, q>a}}\{g\ge q\},
\end{align*}
we obtain
\begin{align*}
\mathbb P(\{g>a\})=0.
\end{align*}
Consequently $\mathbb P(\{g=a\})=1$, so $g$ is equal to the constant $a$ a.e., contradicting the choice of $g$. Therefore there is $t\in\mathbb R$ with
\begin{align*}
0<\mathbb P(\{g<t\})<1.
\end{align*}
If $g=\operatorname{Re}(f)$, choose the Borel half-plane
\begin{align*}
B:=\{z\in\mathbb C:\operatorname{Re}(z)<t\}.
\end{align*}
If $g=\operatorname{Im}(f)$, choose the Borel half-plane
\begin{align*}
B:=\{z\in\mathbb C:\operatorname{Im}(z)<t\}.
\end{align*}
Then $A:=f^{-1}(B)$ is measurable, and by construction
\begin{align*}
0<\mathbb P(A)<1.
\end{align*}
This is the nontrivial measurable set that will contradict ergodicity once we prove it is invariant modulo null sets.[/guided]