Let us start with
$$h(x) = \begin{cases}
\hphantom{-}4(x+2) &, -2\leqslant x < -\frac{3}{2}\\
-4(x+1) &, -\frac{3}{2} \leqslant x < -1\\
-4(x-1) &,
\hphantom{-}\; 1 \leqslant x < \frac{3}{2}\\
\hphantom{-} 4(x-2) &,
\hphantom{-}\frac{3}{2}\leqslant x < 2\\
\qquad 0 &,
\hphantom{-} \text{ otherwise.} \end{cases}$$
For $c > 0$, let
$$h_c(x) = c\cdot h(c\cdot x).$$
Then $h_c$ is continuous, and $\int_{-\infty}^0 h_c(x)\,dx = 1$ as well as $\int_{-\infty}^\infty h_c(x)\,dx = 0$. Now let
$$g(x) = \sum_{n=1}^\infty h_{5^n}\left(x-n-\frac{1}{2}\right).$$
Every $g_n(x) = h_{5^n}\left(x-n-\frac12\right)$ vanishes identically outside the interval $[n,n+1]$, so $g$ is continuous, and
$$f(x) = \int_0^x g(t)\,dt$$
is well-defined and continuously differentiable.
Furthermore, $f(x) \equiv 0$ on every interval $\left[n, n+\frac{1}{2} - \frac{2}{5^n}\right]$, and $f(x) \equiv 1$ on every interval $\left[n+\frac{1}{2}-\frac{1}{5^n}, n+\frac{1}{2}+\frac{1}{5^n}\right]$. Thus on
$$X = \bigcup_{n=1}^\infty \left(\left[n, n+\frac{1}{2} - \frac{2}{5^n}\right] \cup \left[n+\frac{1}{2}-\frac{1}{5^n}, n+\frac{1}{2}+\frac{1}{5^n}\right]\right)$$
we have $f' \equiv 0$, so the derivative is bounded, but
$$f\left(n+\frac{1}{2}-\frac{1}{5^n}\right) - f\left(n+\frac{1}{2}-\frac{2}{5^n}\right) = 1$$
for all $n$, while the distance between the two points is $5^{-n}$ which becomes arbitrarily small, so $f$ is not uniformly continuous on $X$.
If the sentence
Note that $X$ cannot be an interval, a disjoint union of intervals, nor can it be a discrete set.
was meant to forbid a construction as above where $X$ is a disjoint union of intervals, we can obey the letter of the law (but not the spirit) by adding an arbitrary subset of $(-\infty,0)$ that is not a union of disjoint intervals.
The answer is that yes, such a function exists.
The starting point is the Pompeiu Derivative.. To summarize Wikipedia, Pompeiu constructed an everywhere differentiable strictly increasing function $g:[0,1]\rightarrow \mathbb{R}$ whose derivative $g'(x)$ is $0$ on a dense subset of $[0,1]$. Call this dense set $D$.
Now, let $h:\mathbb{R}\rightarrow (0,1)$ be your favorite diffeomorphism (e.g., you could pick $h(x) = \frac{1}{\pi}\arctan(x) + \frac{1}{2}$.)
Set $f(x) = g(h(x)) + x$. I claim that $f$ fulfills your criterion. By the chain rule, $f'(x) = g'(h(x))h'(x) + 1$. For $x\in h^{-1}(D)$, $g'(h(x)) = 0$, so $f'(x) = 1$ for $x\in h^{-1}(D)$. Note that since $h$ is a diffeomorphism, it is a homeomorphism, so $h^{-1}(D)\subseteq \mathbb{R}$ is dense. Lastly, since $g$ is strictly increasing, $f(x) -x$ is strictly increasing, so is not constant.
Best Answer
Let $\phi : [0, 1] \to [0, 1]$ be the Cantor-Lebesgue function, and $\alpha : [0, 1] \to \Bbb{R}^n$ be a space-filling curve.
Since $\phi$ is stationary outside the Cantor set, it is locally constant almost everywhere. That is, $\beta := \alpha \circ \phi$ is also locally constant everywhere, allowing it to be differentiable a.e.. (In fact, $\beta' = 0$ a.e.!) On the other hand, $\phi$ is continuous and surjective. Thus $\beta$ is also a continuous path and the image of $\beta$ coincides with $\alpha$. That is, $\beta$ is also a space-filling curve. Therefore this serves as a counter-example.
Let $f : [0, 1] \to \Bbb{R}^n$ be a differentiable curve in $\Bbb{R}^n$ ($n \geq 2$). Let $\Gamma = f([0, 1])$ be the image of $f$ in $\Bbb{R}^n$.
Assuming that $|f'|$ is Lebesgue integrable, we can prove the first statement.
This theorem immediately implies the following corollary:
Proof. Since $f'$ is Lebesgue integrable, it is absolutely continuous. Thus there exists $\delta > 0$ such that whenever a measurable subset $E \subset [0, 1]$ satisfies $|E| < \delta$, we have $\int_E |f'| < \epsilon$. Now let $\Pi = \{x_k\}$ be a partition of $[0, 1]$ into subintervals with length less than $\delta$. Then for each $x_{k-1} \leq x < y \leq x_k$, $$ |f(y) - f(x)| = \left| \int_{x}^{y} f' \right| \leq \int_{x}^{y} |f'| \leq \int_{x_{k-1}}^{x_k} |f'| < \epsilon. $$ Thus $$ \epsilon_k \leq \int_{x_{k-1}}^{x_k} |f'| < \epsilon $$ and the conclusion follows. ////
Now let $\epsilon > 0$ and $\Pi$ be a corresponding partition of $[0, 1]$ by Corollary. Then we can cover $\Gamma$ by balls $B_{2\epsilon_k}(f(x_k))$ for $k = 1, \cdots, N$. Thus
$$ |\Gamma| \leq \sum_{k=1}^{N} \left|B_{2\epsilon_k}(f(x_k))\right| \leq \sum_{k=1}^{N} C_n \epsilon_k^n \leq C_n \epsilon^{n-1} \sum_{k=1}^{N} \epsilon_k \leq C_n \epsilon^{n-1} \| f' \|_1, $$
where $C_n$ is a constant depending only on the dimension $n$. (In fact, we can choose $C_n = |B_2|$.) Thus taking $\epsilon \to 0$, we have the desired result.