# Inverse image of composite function

There's a nice proof of the theorem about composite functions (see theorem 5 here) that states

$$(g\circ f)^{-1}=f^{-1}( g^{-1})$$

Notice that $f^{-1}$ means the inverse of $f$. Could anyone help me with proving similar equality for preimages?

The preimage of a function is defined as $f^{-1}[Y]=\{x \in X | f(x) \in Y\}$.

Let $f: X \to Y$ and $g: Y \to Z$. The theorem states that for every subset $S \subseteq Z$:

$$(g\circ f)^{-1}[S]=f^{-1}(g^{-1}[S])$$

So the thing is to show that two sets above are equal.

My attempt would be:

Let $M=(g\circ f)^{-1}[S] = \{x\in X | g(f(x))\in S\}$.

then $g^{-1}[S]$ is a set $G=\{y\in Y | g(y))\in S\}$, and $f^{-1}(g^{-1}[S])=\{x\in X | f(x) \in G\}$.

I'm not sure how to proceed with it next.

In general: $$x\in h^{-1}(S)\iff h(x)\in S$$ So the following statements are equivalent:
• $x\in(g\circ f)^{-1}(S)$
• $(g\circ f)(x)\in S$
• $g(f(x))\in S$
• $f(x)\in g^{-1}(S)$
• $x\in f^{-1}(g^{-1}(S))$
This shows that $$(g\circ f)^{-1}(S)=f^{-1}(g^{-1}(S))$$
• Do you know where I can find a proof of the first statement ($x\in h^{-1}(S)\iff h(x)\in S$)? Commented Jan 5, 2023 at 9:12
• @FD_bfa By definition we have $h^{-1}(S):=\{x\in X\mid h(x)\in S\}$. This gives immediately: $$x\in h^{-1}(S)\iff h(x)\in S$$For completeness let me state that $h^{-1}$ is in this context not the notation of an inverse of $h$ (often there is confusion about that). Commented Jan 5, 2023 at 9:17
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/1606868/inverse-image-of-composite-function/1606892", "fetch_time": 1721121326000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-30/segments/1720763514742.26/warc/CC-MAIN-20240716080920-20240716110920-00279.warc.gz", "warc_record_offset": 339220714, "warc_record_length": 35940, "token_count": 550, "char_count": 1469, "score": 4.1875, "int_score": 4, "crawl": "CC-MAIN-2024-30", "snapshot_type": "latest", "language": "en", "language_score": 0.7546502947807312, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00044-of-00064.parquet"}