Suppose function $f:\Omega \rightarrow (\Omega', Y)$ measurable. Define $$X = \sigma(\{f^{-1}(K) : K \in Y\})$$ Prove that for any $A \in X$ and any $w\_1, w\_2\in \Omega$ with $f(w\_1) = f(w\_2)$, either $w\_1, w\_2 \in A$ or $w\_1, w\_2 \in A^{\complement}$.

I was trying to establish that there exists some $D \in Y$ such that $A = f^{-1}(D)$, then the result is trivial. Is it the case that there is such a set $D$?