Suppose $(X,m)$ is a measurable space and $Y$ is a set. Given $\mathscr{S}\subset P(X)$, a family of subsets of $Y$, we can construct a smallest $\sigma$-algebra $\sigma (\mathscr{S})$ containing $\mathscr{S}$, which is the intersection of all the $\sigma$-algebra containing $\mathscr{S}$.
Claim: $f:(X,m)\to (Y,\sigma (\mathscr{S}))$ is measurable iff $f^{-1}(S)\in m$ for any $S\in \mathscr{S}$.
Whether the claim is correct?
Note that in a similar case in general topology, it only suffices to prove the preimage of all the set in a basis is open, if we want to prove a map form a topogoly space to a set with a topology generated by a basis.
In the case of measurable space, the definition of $\sigma (\mathscr{S})$ is rather abstract and its members don't have specific relation with $\mathscr{S}$. However, as we all know, when it comes to a topology generated by a family ofsubsets, its members are clear, which is union of the subsets.
I don't know how to use the definition of $\sigma (\mathscr{S})$ to prove the claim. Any help would be appreciated.