Find preimages of functions A. Given the function $f(x)=(\cos(x), \sin(x)) , f:\mathbb{R}  → \mathbb{R^2}$ ,  find:  


*

*$f^{-1}[(0, 1)] $, in this example $(0,1) \in \mathbb{R^2}$ is a point, not an interval. 

*$f^{-1}[X] $, where $X=\{(x,y) \in \mathbb{R^2},  x \geq 0\}$


B. $\mathbb{(N_+)^{<\mathbb{N}}}$ is a set of all finite sequences with elements in 
$\mathbb{N_+}$. Every sequence has at least one element. We define $f:\mathbb{(N_+)^{<\mathbb{N}}}→\mathbb{N}$ with:
$f((a_n))=\sum_i a_i$
For every finite sequence, the function returns a sum of its elements. Find:


*

*$f^{-1}[\{2,3\}] $

*$f[\{(a_n) \in \mathbb{(N_+)}^{<\mathbb{N}} \mid (a_n)$ has an even number of elements$\}] $


My solutions:
Unfortunately I have no idea how to solve the second task, but I managed to do the first one. I think that $f^{-1}[(0, 1)] = \{\frac{\pi}2\} $, because here $\cos(x)=0$ and $\sin(x)=1$, and $f^{-1}[X] =\mathbb{R}$ . Could you please tell me if it's correct? And I would be grateful if you could explain how to solve task B. 
 A: (I). Let $(x_1,x_2,...)$ denote a sequence .$(x)$ is a one-element sequence. The members of $f^{-1}\{2\}$ are $(2)$ and $(1,1).$ The members of $f^{-1}\{3\}$ are $(3), (2,1), (1,2),$ and $(1,1,1).$ 
(II). For any $k\in \mathbb N:$ Let $s_j=1$ for $1\leq j\leq 2k.$ Let $s'_j=1$ for $1\leq j\leq 2k-1$ and $s_{2k}=2.$ Then $f((s_1,...,s_{2k}))=2k$ and $f((s'_1,...,s'_{2k}))=2k+1.$
So the set $E=\{f(S): S \text { has an even number of elements }\} $ $\supset \cup_{k\in \mathbb N}\{2k,2k+1\}=\mathbb N$ \ $\{1\}.$
Since $f(S)\geq 2$ if $S$ has a positive, even number of elements, we also have $E\subset \mathbb N$ \ $\{1\}.$ Therefore $E=\mathbb N$ \  $\{1\}.$ 
A: We are given the function $f: \mathbb{R} \to \mathbb{R}^2$ defined by $f(x) = (\cos x, \sin x)$.  
Thus, the set $f^{-1}[(0, 1)]$ is the set of all real numbers with cosine $0$ and sine $1$.  As you found, one such point is $\pi/2$.  However, both the sine and cosine functions are periodic with period $2\pi$.  Hence, any point that differs from $\pi/2$ by an integer multiple of $2\pi$ is also in $f^{-1}[(0, 1)]$.  Since no other point in the interval $[0, 2\pi)$ is in $f^{-1}[(0, 1)]$, we may conclude that 
$$f^{-1}[(0, 1)] = \{\frac{\pi}{2} + n\pi \mid n \in \mathbb{Z}\}$$
For the same function, if $X = \{(x, y) \in \mathbb{R}^2 \mid x \geq 0\}$, the set $f^{-1}(X)$ is the set of all real numbers $t$ with the property that $\cos t \geq 0$ (notice that there is no restriction on $y = \sin t$).  Since $\cos t \geq 0$ when the terminal side of angle $t$ lies in the first quadrant, fourth quadrant, or on the $y$-axis, the interval $[-\frac{\pi}{2}, \frac{\pi}{2}] \subseteq f^{-1}(X)$. Since cosine is periodic with $2\pi$, any point that differs from a point in this interval by an integer multiple of $2\pi$ is also contained in $f^{-1}(X)$.  Hence, 
$$f^{-1}(X) = \bigcup_{n \in \mathbb{Z}} \left[-\frac{\pi}{2} + 2n\pi, \frac{\pi}{2} + 2n\pi\right]$$
Maik Pickl and Daniel Wainfleet have explained how to solve the second question.
