Finding a bijective function from $A$ to $B$ 
Find a bijective function from $A := \left\{ f\colon \mathbb N \to \mathcal{P}(\mathbb N)\right\}$ to $B := \left\{g\colon \mathbb N \times \mathbb N \to \{0, 1\}\right\}$.

I have been trying to solve this one for over an hour without success. Any help?
 A: How about $$U \colon A \to B , \quad U(f)(x,y) = 1 \Longleftrightarrow y \in f(x),$$
with inverse $$V \colon B \to A, \quad V(g)(x) = \{ y \mid g(x,y) = 1\}.$$
Added: Nothing special about $\mathbb{N}$; it works for any set $S$. If one thinks of $\mathcal{P}(S)$ as $S\to \{0,1\}$, then the statement is equivalent to $$S \to (S\to \{0,1\}) \simeq (S\times S) \to \{0,1\} ,$$
or, in the power notation,
$$\left( \{0,1\}^S\right)^S \simeq (\{0,1\})^{S\times S}$$
This is a particular case of the more general result that $(X^Y)^Z \simeq X^{Y\times Z}$.
A: I'd like to elaborate a bit more on the nice answer of Catalin Zara. Namely, how can one possibly come up with those functions? For this it is helpful to recall what the power set $\mathcal{P}(\mathbb{N})$ is
$$\mathcal{P}(\mathbb{N}) = \{ M\subseteq \mathbb{N} \}.$$
How can one construct a subset of $\mathbb{N}$? For every natural number we can either include it in our set or not. Thus, we can encode every subset of $\mathbb{N}$ as a function $\mathbb{N}\rightarrow \{ 0, 1\}$ deciding for every element of $\mathbb{N}$ wheter it belongs to the subset or not. More formally, the following is a bijection
$$\phi: \ \mathcal{P}(\mathbb{N}) \rightarrow \{f: \mathbb{N}\rightarrow \{0,1\}\}, \ M \mapsto \phi(M)$$
where $\phi(M)(n)=1$ if $n$ lies in $M$ and $\phi(M)(n)=0$ if it doesn't lie in $M$. The inverse map is given by
$$ \phi^{-1}: \{f: \mathbb{N}\rightarrow \{0,1\}\} \rightarrow \mathcal{P}(\mathbb{N}), \ f \mapsto \{ n\in \mathbb{N}: f(n)=1 \}.$$
In the your question we want to encode functions $f: \mathbb{N} \rightarrow \mathcal{P}(\mathbb{N})$. Using the bijection of the previous paragraph we can think of the set $f(n)$ as being the function $\phi(f(n)): \mathbb{N} \rightarrow \{0 ,1 \}$. Letting $n\in \mathbb{N}$ vary we get a function $\phi(f(\cdot))(\cdot): \mathbb{N} \times \mathbb{N} \rightarrow \{0,1 \}$. This is precisely the function $U$ given in Catalin Zara's answer. Namely
$$ U(f)(n)(m) = \phi(f(n))(m).$$
We get its inverse function $V$ be similar reasoning. If we have a function $g: \mathbb{N}\times \mathbb{N} \rightarrow \{0,1\}$ and fix some $n\in \mathbb{N}$, then we get a function $g(n, \cdot): \mathbb{N}\rightarrow \{0,1\}$. But this defines a subset of $\mathbb{N}$. Applying $\phi^{-1}$ yields the inverse function of $U$ denoted by $V$ in Catalin Zara's answer. I.e.
$$ V(g)(n)= \phi^{-1}(g(n,\cdot)).$$
As mentioned in Catalin Zara's answer, this construction is completely general and does not depend on $\mathbb{N}$. To get the argument for a general set $S$ one simply replaces every $\mathbb{N}$ by $S$.
