Is this function injective / surjective? A question regarding set theory.
Let $g\colon P(\mathbb R)\to P(\mathbb R)$, $g(X)=(X \cap \mathbb N^c)\cup(\mathbb N \cap X^c)$
that is, the symmetric difference between $X$ and the natural numbers.
We are asked to show if this function is injective, surjective, or both.
I tried using different values of $X$ to show that it is injective, and indeed it would seem that it is, I can't find $X$ and $Y$ such that $g(X)=g(Y)$ and $g(X) \neq g(Y)$ but how do I know for sure? How do I formalize a proof for it?
Regarding surjective: I think that it is.
We can take $X=\mathbb R - \mathbb N$ and we get that $g(X)=\mathbb R$
What do I do about the injective part?

We can view subsets of $X$ as functions $X \to \{0,1\}$: 0 if the point is not in the set, It is commonly very useful to rewrite questions about subsets as questions about functions.
What form does $g$ take if we do this rewrite?

Terminology wise, if $S \subseteq X$, then $\chi_S$ is the function described above:
$$\chi_S(x) = \begin{cases} 0 & x \notin S \\ 1 & x \in S \end{cases} $$
It is called the characteristic function of $S$.
