The below exercise and the axiom to which it pertains can be found in Tao's Analysis I, which I am currently self studying.
Axiom 3.11 (Power set Axiom) For any two sets $X$ and $Y$, there exists a set, denoted $Y^X$, which consists of all functions from $X$ to $Y$. Thus, $$f\in Y^X \ \iff \ (f \ \text{is a function such that} \ f:X\to Y).$$ Exercise 3.4.6 Show that the above axiom implies the existence of the set $$2^X:=\{S\mid S\subseteq X\},$$ which consists of all subsets of a set $X$. (Hint: start with the set $\{0,1\}^X$ and apply the replacement axiom, replacing each function $f$ with the object $f^{-1}(\{1\})$.
As the author suggested, we start with the set $$\{0,1\}^X = \{f\mid f:X\to\{0,1\}\},$$ and replace its elements with subsets of $X$. Clearly, this procedure yields the set $2^X$ however, I am unsure how I can apply the axiom of replacement. How can I do this bit? Any hints or tips are greatly appreciated.
Edit: This question has been asked and answered elsewhere, I have just found.
characteristic functionof a subset. – Bernard Jun 12 '18 at 19:18