How to find $\sigma$-algebra for given that a function $f:X\to Y$ is measurable? Let $X=\{1,a,b,c\}$, $Y=\{2,A,BC\}$ be two sets, and $f:X\to Y$  be a function such that: $f(1)=2$, $f(a)=A$, and $f(b)=f(c)=BC$. Choosing $\mathcal{G}=\{\underbrace{\{2\}}_{\textrm{set~}G_1}, \underbrace{\{2,BC\}}_{\textrm{set~}G_2}\}$, we then have 
\begin{align}
%\displaybreak
\sigma(\mathcal{G}) &=
\left\{
  \begin{array}{c}
    Y, \varnothing, \\
    G_1, G_2, G_1^c, G_2^c \\
    G_1\cup G_2, (G_1\cup G_2)^c
  \end{array}
\right\}
\equiv
\left\{
  \begin{array}{c}
    \{2, A, BC\}, \varnothing, \\
    \{2\},  \{2, BC\}, \{A, BC\}, \{A\}
  \end{array}
\right\}.
\end{align}
I now present my problem below:


*

*Consider 2 measurable spaces $(X,\mathcal{A})$ and $(Y,\sigma(\mathcal{G}))$.

*By definition of measurable function, the function $f$ is said to be measurable if $f^{-1}(G_1)\in\mathcal{A}$ and $f^{-1}(G_2)\in\mathcal{A}$ as well.


Question 1: How to find $f^{-1}(G_1)$ and $f^{-1}(G_2)$? Are they sets?
Question 2: How can we find a relevant $\sigma$-algebra $\mathcal{A}$ that makes $f$ be measurable? Can anyone give me an exact solution please!?
Regards,
 A: One small correction: you should have $\{2, A\}$ and $\{BC\}$ in the $\sigma$-algebra on $Y$. Do you see why?
Question 1: Yes, they're subsets of $X$. We define $f^{-1}(G_i)$ to be the set of all of the elements in $X$ that get mapped to $G_i$ by $f$. This is the preimage of $G_i$ in $X$. So just collect all of the elements which get mapped to $G_i$.
Question 2: To make this map measurable, we have to make sure that $f^{-1}(G_i)$ lives in the $\sigma$-algebra on $X$. There's an easy way to create a $\sigma$-algebra on $X$ which includes these sets. Hint: you've already done this once to create a $\sigma$-algebra on $Y$. 
If you take this $\sigma$-algebra, generated by the $f^{-1}(G_i)$s, then $f$ will be measurable. 
Note that ordinarily we'd have to take the $\sigma$-algebra of the preimages of everything in $Y$'s $\sigma$-algebra. But because the algebra on $Y$ is generated by the $G_i$s, it's enough to let the $\sigma$-algebra on $X$ be generated by the preimages of these two sets. In other words, it's enough to guarantee measurability of $f$ on the generators of $Y$'s algebra. That's just because taking preimages commutes with taking intersections, unions, complements, etc. 
A: Many thanks to @Josh Keneda,
I now correct $\sigma(\mathcal{G})$ in the last post as follows:
\begin{align}
\sigma(\mathcal{G}) &=
\left\{
  \begin{array}{c}
    \{2, A, BC\}, \{\varnothing\}, \\
    \{2\},  \{2, BC\}, \{A, BC\}, \{A\}, \{2, A\}, \{BC\}
  \end{array}
\right\}.
\end{align}
The answer to Q1 is provided by @Josh
For Q2, let $\mathcal{K}=\{f^{-1}(G_1), f^{-1}(G_2)\}$ be a collection of sets $f^{-1}(G_1)$ and $f^{-1}(G_2)$. So can I find $\mathcal{A}$ by forming $\mathcal{A}=\sigma\left(\mathcal{K}\right)$?
