$\newcommand{\N}{\mathbb N}\newcommand{\R}{\mathbb R}\newcommand{\md}{\ (\operatorname{mod}2)}$This is to present a formalized version of the nice answer by Christian Remling.
Suppose that a function $f\colon\N\to\N$ as in question exists for $K=\{0,1\}$. Without loss of generality (wlog), $f$ is (strictly) increasing, and hence $f(k)\ge k$ for all $k\in\N$.
Let $g(0):=0$ and $g(m+1):=f(g(m)+1)$ for $m\in\N_0:=\N\cup\{0\}$. Then $g(m+1)\ge g(m)+1$ for $m\in\N_0$ and hence $g$ is increasing on $\N_0$.
Let $(x_n)$ be the sequence such that
\begin{equation*}
x_n= m \md\text{ if }g(m)<n\le g(m+1) \tag{1}\label{1}
\end{equation*}
for some $m\in\N_0$.
Suppose that a subsequence $(x_{n_k})$ of the sequence $(x_n)$ converges. Wlog $1\le n_1<n_2<\cdots$, so that $n_j\ge j$ for all $j\in\N$.
For $m\in\N_0$, let
\begin{equation*}
J(m):=\min\{j\in\N\colon n_j>g(m)\}. \tag{2}\label{2}
\end{equation*}
Then $1\le n_1<\cdots<n_{J(m)-1}\le g(m)$, so that $J(m)-1\le n_{J(m)-1}\le g(m)$, $J(m)\le g(m)+1$, and $f(J(m))\le f(g(m)+1)=g(m+1)$. So, recalling the condition $n_k\le f(k)$ for all $k\in\N$, we get
\begin{equation*}
g(m)<n_{J(m)}\le f(J(m))\le g(m+1).
\end{equation*}
So, by \eqref{1},
\begin{equation}
x_{n_{J(m)}}=m \md \tag{3}\label{3}
\end{equation}
for all $m\in\N_0$.
On the other hand, the integer-valued function $g$ is (strictly) increasing. So, by \eqref{2}, $J(m)\to\infty$ as $m\to\infty$.
Thus, \eqref{3} contradicts the assumption that the subsequence $(x_{n_k})$ of the sequence $(x_n)$ converges. $\quad\Box$