Suppose that $X$ is a random variable, $\mathcal{F}$ is a sub-$\sigma$-field and $g$ is some functions. I know that for any $\epsilon>0$, $$ \lvert\mathsf{E}[g(X)\mid\mathcal{F}]\rvert\le C\epsilon+\mathsf{E}[\lvert X\lvert\mid\mathcal{F}]\epsilon^{-1} \quad\text{a.s.} $$
Does this inequality remain true for a random $\epsilon$? It seems that the answer is positive because we can approximate $\epsilon$ be simple random variables $\{\epsilon_n\}$ converging to $\epsilon$ pointwise and for each $\epsilon_n$ the inequality holds a.s. on $\{\epsilon>0\}$
The goal is to set $\epsilon=\sqrt{\mathsf{E}[\lvert X\rvert\mid \mathcal{F}]/C}$ which corresponds to the optimal bound of that inequality.
What we know is that for each positive $\varepsilon$, there exists a set $\Omega_\varepsilon $ of probability $1$ such that for all $\omega\in\Omega_\varepsilon$, $$\lvert\mathsf{E}[g(X)\mid\mathcal{F} ]\left(\omega\right) \rvert\leqslant C\epsilon+\mathsf{E}[\lvert X\lvert\mid\mathcal{F}]\left(\omega\right)\epsilon^{-1}.$$ In order to safely replace $\varepsilon$ be something random, we should have the previous inequality on a set of probability one independent of $\varepsilon$.
To this aim, let $\Omega':=\bigcup_{\substack{ \varepsilon\in \mathbb Q\\ \varepsilon\gt 0}}\Omega_\varepsilon$. Then $\Omega'$ has probability one and for all $\omega\in\Omega'$ and all positive rational number $\varepsilon$,
$$\tag{*} \lvert\mathsf{E}[g(X)\mid\mathcal{F} ]\left(\omega\right) \rvert\leqslant C\epsilon+\mathsf{E}[\lvert X\lvert\mid\mathcal{F}]\left(\omega\right)\epsilon^{-1}.$$ Now, if $\varepsilon$ is a positive real number, there exists a sequence of rational positive numbers $\left(\varepsilon_n\right)_{n\geqslant 1}$ which converges to $\varepsilon$, hence applying (*) to $\varepsilon_n$ and letting $n$ going to infinity gives what we want.