We define integrals using an infinite process; in order for each step of the process to make sense, we need functions to be measurable.1
A function between the base sets of two measurable spaces is measurable with respect to the distinguished sets of the two spaces if the inverse image of every distinguished subset of the codomain is a distinguished subset of the domain.
Let $(X, \mathcal{A} )$ and $(Y, \mathcal{B} )$ be measurable spaces. Then a function $f: X \to Y$ is measurable if $B \in \mathcal{B} $ implies $f^{-1}(B) \in \mathcal{A} $. We say that $f$ is measurable with respect to $\mathcal{A} $ and $\mathcal{B} $.
In this case, we sometimes say $f$ is a measurable function from $(X, \mathcal{A} )$ to $(Y, \mathcal{B} )$. We say, $f: (X, \mathcal{A} ) \to (Y, \mathcal{B} )$ is measurable, read aloud as “f from X, A to Y, B is measurable.”