I apologize for the title in advance, but this is a long problem. So, here it is:
Suppose $\mathcal{S}$ is a $\sigma$-algebra on a set $X$ and $A \subset X$. Let $$\mathcal{S}_A = \{E \in \mathcal{S} : A \subset E \text{ or } A \cap E = \emptyset\}$$
In the first question in this exercise, we're asked to show that $\mathcal{S}_A$ is a $\sigma$-algebra, which I have done and we can certainly use it if necessary in the second question, which is the one I'm struggling with. Here is the entire question:
Suppose $f: X \rightarrow \mathbb{R}$ is a function. Prove that $f$ is measurable with respect to $\mathcal{S}_A$ if and only if $f$ is measurable with respect to $\mathcal{S}$ and $f$ is constant on $A$
I was able to show that if $f$ is measurable with respect to $\mathcal{S}_A$ then it would be measurable with respect to $\mathcal{S}$ simply because $f^{-1}(B) \in \mathcal{S}_A$ for any Borel set $B$, but by the way $\mathcal{S}_A$ is defined, that would mean $f^{-1}(B) \in \mathcal{S}$ as well. The part that I'm struggling with is to first show that not only $f$ would be measurable with respect to $\mathcal{S}$ but also $f$ would be constant on $A$, and second is to show the converse to conclude the equivalence that is required. So, would anyone be able to help, please?
To show that $f$ is a constant on $A$ take $a,b \in A$ and suppose $f(a)=c \neq d=f(b)$. Then $f^{-1} (\{c\})$ and $f^{-1} (\{d\})$ belong to $\mathcal S _A$ but $A$ is neither contained in $f^{-1} (\{c\})$ nor is it disjoint from it. [ $b \in A$ and $b \notin f^{-1} (\{c\})$; Also, $a \in f^{-1} (\{c\}) \cap A$].
This contradiction proves that we must have $c=d$ or $f(a)=f(b)$.
The converse part is really trivial. If $f$ is a constant on $A$ what is the inverse image of any Borel set?