Let $A,\ A_{k+1},\ldots,A_{n}$ be Borel subsets of $\mathbb{R}$.
Write
\begin{align}
\mathbb{P}[f(X_1,\ldots,X_k)\in A, X_{k+1} \in A_{k+1}, \ldots, X_n \in A_{n}] =
\mathbb{P}[(X_1,\ldots,X_k)\in f^{-1}(A), X_{k+1},\ldots,X_n)
\end{align}
Decompose $f^{-1}(A)\in \mathbb{R^k}$ to the cartesian product of $A_1,\ldots,A_k \in \mathbb{R}$, that is $f^{-1}(A) = A_1 \times \ldots \times A_k$.
Clearly \begin{equation}
(X_1,\ldots X_k) \in f^{-1}(A) \Leftrightarrow X_1\in A_1, \ldots, X_k \in A_k \qquad (1)
\end{equation}
Use (1) and the independence of $X_i,\ i = 1,\ldots n$ to deduce
\begin{align}
\mathbb{P}[X_1 \in A_1, \ldots X_k \in A_k, X_{k+1}\in A_{k+1}, \ldots X_n \in A_n] &= \prod^k_{i=1} \mathbb{P}[X_{i} \in A_i] \cdot \prod^n_{i=k+1} \mathbb{P}[X_i \in A_i] \\
\end{align}
Finally using again (1) write
\begin{equation}
\prod^k_{i=1} \mathbb{P}[X_{i} \in A_i] = \mathbb{P}[f(X_1,\ldots,X_k) \in A]
\end{equation}
proving that $f(X_1,\ldots X_k), X_{k+1}\ldots X_n$ are independent.