The concept you are looking for is almost surely: suppose in the probability space $(\Omega,\boldsymbol{\mathfrak A},\Pr),$ we are investigating to see whether a property $P$ holds.
Now what we actually want to check is whether devoid of a null set $N\in\boldsymbol{\mathfrak A}, $ i.e. $\Pr[N]=0,$ all $\omega\in\Omega$ satisfies the property $P, $ that is, whether $$ \Pr[\omega\in\Omega\setminus N:P]=1.$$
Coming to the equality case of Jensen's Inequality, its derivation is based on the fact that for a convex function $g$ defined on an open internal $I, $ we have for every $m\in[(D_\ell g) (x_0), (D_r g) (x_0) ], $ for all $x_0\in I, $ $$g(x)\geq m(x-x_0)+g(x_0),~~x\in I. $$ So, the equality would imply $g$ must be a straight line.
Whenever you are integrating w.r.t. a measure (in this case, probability measure), it only depends on how the measurable function is defined on a non-null set. Since $g$ is defined on $I, $ it is continuous on $I$ and hence $\boldsymbol{\mathfrak B}_\mathbb R/\boldsymbol{\mathfrak B}_\mathbb R$-measurable. If it is defined as $a+bX$ on $\mathbb R\setminus N$ where $N$ is a null set, then you will attain the equality.