notice, the hollow dot endpoints, is where the subfunction does not include that value of "x", and where the dot is a solid dot, that value is included in the subfunction.
so the piece-wise is simply the composition of all its subfunctions, in this case 3 subfunctions, within their range, notice the lines continue on the dashed line part, but that part is not included in the piece-wise because is outside the range provided for "x".
One -to -one means each element has an element only it matches to. This is only possible when sets have the same number of elements. #1 doesn't but #2 does.
To determine the number of one-to-one correspondence, use a factorial with the number of elements. 4 is the number and the factorial is 4! = 4*3*2*1 = 24.
n(A) means the cardinal number of the set or the number of unique elements. Elements count only once even if they repeat. There are 5 in #4 and 12 in #5.