Task:
Find the cardinality of all such functions $f: P(\mathbb N) \rightarrow P(\mathbb N)$ that $f(\bigcup S) = \bigcup \lbrace f(Z) \mid Z \in S \rbrace$
The answer is: $\mathfrak c$
My approach:
Define $R(A)$ as the set of all equivalence relations on $A$. Let's denote the set of desired function by $A$. There are at most $2^{\mathfrak{c}}$ functions, so $A \le 2^{\mathfrak{c}}$. On the other hand there are $2^{\mathfrak{c}}$ equivalence relations on $P(\mathbb{N})$. An equivalence relation is equivalent to the division of the set. For a given relation $r$ we define $$f_r : P(\mathbb{N}) \rightarrow P(\mathbb{N}): f_r(S) = \bigcup_{X \in S} [X]_r $$ This mapping $R(P(\mathbb N)) \rightarrow A : r \mapsto f_r$ is injective wrt to $r$. Indeed, let's take two different relations $r,s$. WLOG assume $r \not\subset s$. Then there exists such pair $X$ that $[X]_r \neq [X]_s$. WLOG assume $[X]_r \not\subset [X]_s$.So there exists some $Y \in P(\mathbb N)$ that $X r Y$ but $\neg(X s Y)$. Then $Y \in f_r(X)$ but $Y \not \in f_s(X)$, so $f_r(X) \neq f_s(X)$. Hence $f_r \neq f_s$ So the mapping is injective and set $\lvert A \rvert = 2^{\mathfrak{c}}$
Where did I make a mistake?
Your definition of $f_r$ doesn't even define a function $P(\mathbb{N})\to P(\mathbb{N})$. If $S\in P(\mathbb{N})$, then each $X\in S$ is an element of $\mathbb{N}$, not an element of $P(\mathbb{N})$, so $[X]_r$ is not defined. In any case, even if it were defined, I don't know why $[X]_r\neq [X]_s$ would imply $f_r(X)\neq f_s(X)$; two different collections of sets can have the same union.
Here's a hint towards a correct solution to the problem, if you want one: