Can someone review my solution for the following exercise?
Construct a choice function for
All nonempty finite subsets of $\mathbb{R}$
All nonempty subsets of $\mathbb{Z}$
Solution:
2.
$A \in \{X: X \subset \mathbb{Z}\} \setminus \{\emptyset\}$
$f(A) = \begin{cases} \min\{x:x\in A\}, & \forall x \in A:x>0 \\ \max\{x:x\in A\}, & \forall x \in A:x<0 \\ 0, & 0 \in A \\ \min\{\vert x \vert: x\in A\}, & \text{else} \end{cases}$
1.
$A \in \{X: X \subset \mathbb{R}, \# A < \infty \} \setminus \{\emptyset\}$
$f(A)=\min\{x:x \in A\}$
The first solution is not entirely correct. If $A=\{-1,2\}$ then $f(A)=1$ as you define it, but $1\notin A$.
Instead, you can compress all the cases into a correctly formed $$f(A)=\min\{x\in A:|x|=\min\{|x|:x\in A\}\}.$$