How much a càdlàg (i.e., right-continuous with left limits) function can jump? I have changed the title (replaced "well-behaved" by "càdlàg"), since it seems that "a well-behaved function" might be interpreted as "a function of bounded variation" (rather than "a càdlàg function", which I actually meant).
Let $f:[0,1] \to {\bf R}$ have a following property: $f$ is continuous except at the points $x_{k,n} = \frac{{2k - 1}}{{2^n }}$, $k=1,\ldots,2^{n-1}$, $n=1,2,3,\ldots$, where $\lim _{x \downarrow x_{k,n} } f(x) = f(x_{k,n} )$ but $f(x_{k,n} ) -
\lim _{x \uparrow x_{k,n} } f(x) = a_n  > 0$. Can such a function exist if $a_n > 1/ \log(n)$ for all sufficiently large $n$?
 A: If $f\colon[0,1]\to\mathbb{R}$ is cadlag (continu à droite, limites à gauche) then we can ask what the possible jumps are. That is, for what functions $g\colon(0,1]\to\mathbb{R}$ is there a cadlag function $f$ with $g(x)=\Delta f(x)\equiv f(x)-f(x-)$?
The answer is that $g$ occurs as the jumps of a cadlag function if and only if the set $\{x\in(0,1]\colon\vert g(x)\vert > \epsilon\}$ is finite for each $\epsilon > 0$. In particular, there is a cadlag function with jumps as you describe.
First, the necessity: If $S=\{x\in(0,1]\colon\vert g(x)\vert > \epsilon\}$ was not finite, then it would contain a strictly increasing or strictly decreasing sequence $x_n$. Then, $\vert f(x_n)-f(y_n)\vert > \epsilon$ for some $y_n$ chosen arbitrarily close to $x_n$. Replacing $x_n$ by $y_n$ where necessary gives a strictly increasing or strictly decreasing sequence $x_n\in[0,1]$ such that $\vert f(x_{n+1})-f(x_n)\vert > \epsilon/2$. However, as f is cadlag and has left and right limits everywhere, this contradicts the requirement that $f(x_n)$ tends to a limit.
Now, we can show sufficiency: Set $\epsilon_n=2^{-n}$ for $n\ge1$ and $\epsilon_0=\infty$. For each $n\ge1$, consider the finite set $S_n=\{x\in(0,1]\colon \epsilon_{n-1}\ge\vert g(x)\vert > \epsilon_n\}$. We can construct a function $f_n\colon[0,1]\to\mathbb{R}$ such that $\Delta f_n(x)=1_{\{x\in S_n\}}g(x)$ and $\vert f_n(x)\vert\le\epsilon_{n-1}$. The idea is to take $f_n(x)=g(x)$ and $f_n(x-)=0$ for points in $S_n$, and linearly interpolate between these.
More precisely, if $S_n$ is empty we set $f_n=0$. Otherwise,
$$
f_n(x)= g(a)(b-x)/(b-a)
$$
for $a\le x < b$. Here, $a < b$ are consecutive points of $S_n$. Also set $f_n(x)=0$ for $x$ less than the minimum of $S_n$ and $f_n(x)=g(c)$ for $x\ge c=\max S_n$. This has the required jumps $\Delta f_n(x)=1_{\{x\in S_n\}}g(x)$.
Finally set $f(x)=\sum_{n=1}^\infty f_n(x)$. As $\vert f_n\vert \le 2^{1-n}$ for $n\ge 2$ this converges uniformly and,
$$
\Delta f(x)=\sum_n\Delta f_n(x)=\sum_n1_{\{x\in S_n\}}g(x)=g(x).
$$
