I've read this and many other questions in here, but while the question I've just posted is very similar, it is not exactly the same as mine.
I have (as in the linked question) found two definitions of a measurable function:
Definition 1 (see here): Let $(X, \Sigma)$ and $(Y, T)$ be measurable spaces. A function $$f:X\longrightarrow Y$$ is said to be measurable if $\,\,\forall E\in T$ $$f^{-1}(E) := \{x\in X \,\, | \,\, f(x)\in E\} \in \Sigma $$ That is, if the preimage of any $T$-measurable set is $\Sigma$-mesurable.
Definition 2 (see here): Let $(X, \Sigma)$ be a measurable space and $E\in\Sigma$ be a $\Sigma$-measurable set. A function $$f:E\longrightarrow \mathbb{R}$$ is said to be $\Sigma$-measurable on $E$ iff $\,\,\forall \alpha \in \mathbb{R}$ $$\{x\in E \,\, | \,\, f(x) \leq \alpha\}\in \Sigma$$ That is, if given any $\Sigma$-measurable set $E$, all the sets of elements of $E$ whose image under $f$ is less than or equal than some real number $\alpha$.
To me these definitions are miles away, super different. How can they be the same?
"Equivalence" proof
Here I try to show that they are somewhat similar, following the answer from Yanko.
Let $(X, \Sigma)$ and $(Y, T)$ be measurable spaces and let $f:X\longrightarrow Y$ be a measurable function. Now, we set $Y = \mathbb{R}$ and so we work with $(X, \Sigma)$ and $(\mathbb{R}, T \subseteq\mathcal{P}(\mathbb{R})$ where $\mathcal{P}(\mathbb{R})$ indicates the power set of $\mathbb{R}$. The our function $f$ becomes $$f: X\longrightarrow \mathbb{R}$$ and by definition of a measurable function it is such that $\forall E\in T \subseteq \mathcal{P}(\mathbb{R})$ $$f^{-1}(E) := \{x\in X \,\, | \,\, f(x)\in E\} \in \Sigma$$