Let $\left(M,\sigma\left(\tau\right)\right)$ a measure space with $\sigma\left(\tau\right)$ a Borel $\sigma$-algebra where $\tau$ is a topology in $M$. Suppose there is a collection $\mathcal{B}$ of elements in collection $\mathcal{B}$ in $\sigma\left(\tau\right)$ such that $\sigma\left(\tau\right)$ is generated by $\mathcal{B}$ and $\mu\left(B\right)=\mu\left(f^{-1}\left(B\right)\right)$ for all $B\in\mathcal{B}$, then $\mu\left(E\right)=\mu\left(f^{-1}\left(E\right)\right)$ for all $E\in\sigma\left(\tau\right)$.
Remark: If $\mathcal{B}$ is an algebra, then the proof is easy, it can be found in the book Ergodic Theory of Ricardo Mañé. The question is that $\mathcal{B}$ is not necessarily an algebra, then I thought about looking for an algebra $\mathcal{C}$ contaning $\mathcal{B}$ such that $\mu\left(C\right)=\mu\left(f^{-1}\left(C\right)\right)$ for all $C\in\mathcal{C}$. Precisely, I thought the candidate for that algebra was
$\mathcal{C}=\left\{C\in \sigma\left(\tau\right) : \mu\left(C\right)=\mu\left(f^{-1}\left(C\right)\right) \right\} $
but I could not prove that $\mathcal{C}$ is an algebra. I'm thinking that's not true, but i can not find a counterexample. Really, I'm thinking that in the main question we need more conditions on the collection $\mathcal{B}$, but i can not find a counterexample.