There is the theorem: Let $Y$ and $Z$ be topological spaces, and let $g:Y\to Z$ be continuous.
$(a)$ If $X$ is a topological space, if $f:X\to Y$ is continuous, and if $h$ $=$ $g$ $\circ$ $f$, then $h:X\to Z$ is continuous.
$(b)$ If $X$ is a measurable space, if $f:X\to Y$ is measurable , and if $h$ $=$ $g$ $\circ$ $f$, then $h:X\to Z$ is measurable.
There is the proof:
If $V$ is open in $Z$, then $g^{-1}(V)$ is open in $Y$, and
$h^{-1}(V)$ $=$$f^{-1}(g^{-1}(V))$
If f is continuous, it follows that $h^{-1}(V)$ is open, proving $(a)$.
If f is measurable , it follows that $h^{-1}(V)$ is measurable, proving $(b)$.
I don't understand that why is $h^{-1}(V)$ equal of $f^{-1}(g^{-1}(V))$
Any help would be appreciated.
As @jjagmath said, it is a question about basic set theory. I will use a double inclusion and the definition of the reciprocal image of a part of a set.
Let $x \in h^{-1}(V)$. $h(x) \in V$ i.e. $g(f(x))\in V$. So $f(x)\in g^{-1}(V)$. And $x \in f^{-1}[g^{-1}(V)]$.
Let $x\in f^{-1}[g^{-1}(V)]$. $f(x) \in g^{-1}(V)$. So, $h(x)=g[f(x)]\in V$. So, $x \in h^{-1}(V)$.