Basic exercises on decision trees
ID3 is a heuristic. It is not guaranteed to generate an optimal decision tree.
Here is an algorithm for Exercise 1:

If $X_3 = 1$, then answer $2X_1-1$.
If $X_3 = 0$, then answer $2X_4-1$.

For Exercise 2, suppose $f_k = X_1 \lor \cdots \lor X_k$. An optimal decision tree simulates the following algorithm:

If $X_1 = 1$, output 1, else continue.
If $X_2 = 1$, output 1, else continue.
...
If $X_k = 1$, output 1, else output 0.

Indeed, every decision tree for $f_k$ must query all of $X_1,\ldots,X_k$ in the worst case.