Let us define for a function $f\colon X \to Y$ between metric spaces the minimal nondecreasing modulus of continuity as
$$\omega_f(\delta) := \sup \{ d(f(x),f(y)) : d(x,y) \leqslant \delta\}.$$
Among all monotonic functions that are admissible as a modulus of continuity of $f$, that is the smallest one. Non-monotonic moduli of continuity can be smaller at some values of course, consider a periodic function for example.
$f$ is uniformly continuous if and only if
$$\lim_{\delta \searrow 0} \omega_f(\delta) = 0.$$
The function $\omega_f$ is subadditive, $\omega_f(\delta + \varepsilon) \leqslant \omega_f(\delta) + \omega_f(\varepsilon)$ for functions whose domain is a convex domain in $\mathbb{R}^n$, hence $\omega_f(t)$ is finite for all $t \in [0,\infty)$ if $\omega_f(\delta) < \infty$ for some $\delta > 0$ then. For a space with infinitely many connected components that are at a positive distance from each other, $\omega_f(t)$ can be infinite for finite $t$ even for uniformly continuous $f$. We have
$$\omega_{\omega_f} \leqslant \omega_f,$$
so if $f$ is uniformly continuous, so is $\omega_f$, for functions with good domain.
Thus the question in the title can be answered affirmative, a uniformly continuous function $\mathbb{R}\to \mathbb{R}$ always has a (uniformly continuous) modulus of continuity that attains only finite values on $[0,\infty)$.
Note that $\lim\limits_{t\searrow 0} \omega(t) = \omega(0) = 0$ is part of the definition of a modulus of continuity, so if a function $f$ admits a global modulus of continuity, it must be uniformly continuous, and then allowing moduli of continuity that attain the value $\infty$ for finite $t$ is somewhat pointless for functions on good domains, but for functions on spaces with separated components, it can be necessary. And when one considers only local moduli of continuity (at a fixed point $x_0$), allowing infinite values is a simple way to not care about the behaviour far enough away from $x_0$.
You definitely need the target space to be Hausdorff. Theorem $\mathbf{5.4}$ of Gerlits, Juhász, Soukup, & Szentmiklóssy, Characterizing continuity by preserving compactness and connectedness, says that if $X$ is $T_3$, and every connectedness-preserving, compactness-preserving map from $X$ to a $T_1$ space is continuous, then $X$ is discrete. Thus, there must be a $T_1$ space $Y$ and a connectedness-preserving, compactness-preserving map $f:\Bbb R\to Y$ such that $f$ is not continuous. In fact, let $Y$ denote $\Bbb R$ with the cofinite topology, and define
$$f:\Bbb R\to Y:x\mapsto\begin{cases}
1,&\text{if }x=2^{-n}\text{ for some }n\in\Bbb N\\
x,&\text{otherwise}\;.
\end{cases}$$
Then $f$ is not continuous, since the inverse image of $\{1\}$ is not closed in $\Bbb R$. $Y$ is hereditarily compact, so $f$ certainly preserves compactness. Finally, if $C\subseteq\Bbb R$ is connected, then either $|C|=1$, in which case $f[C]$ is connected, or $C$ contains a non-empty open interval, in which case $f[C]$ is infinite and therefore connected.
The positive result closest to what you want is Corollary $\mathbf{2.4}$ of the same paper, which says that if $X$ is locally compact, locally connected, and monotonically normal, and if $f$ is a connectedness-preserving, compactness-preserving map from $X$ to a $T_3$ space, then $f$ is continuous.
Best Answer
Let $f:X\to\mathbf{R}$ satisfying your hypotheses. There exists $K$ compact s.t. $f_{|X \setminus K}=0$.
Let's show $f$ is uniformly continuous. Let $\epsilon>0$. By Heine theorem applied to $f_{|K}$, $f$ is uniformly continuous on $K$:
$$\exists \delta_1>0 \; \forall (x, y) \in K^2 \; d(x,y) < \delta_1 \implies |f(x)-f(y)| < \epsilon$$
If $(x, y) \in (X\setminus K)^2$, $\delta_1$ works.
Now suppose by contradiction that there exists $\epsilon>0$ s.t. for all $n \in \mathbf{N}$, there exists $x_n \in K$, $y_n \in X\setminus K$ s.t. $d(x_n, y_n) < 2^{-n}$ and $|f(x_n) - f(y_n)| > \epsilon$. $(x_n)$ lies in a compact space, so there exists $\sigma$ strictly increasing and $x \in K$ s.t. $x_{\sigma(n)} \to x$. Then $y_{\sigma(n)} \to x$, but $|f(x_{\sigma(n)}) -f(y_{\sigma(n)})| > \epsilon$, thus $f$ is not continuous in $x$, contradiction.
Hence:
$$\exists \delta_2>0 \; \forall (x, y) \in K \times (X \setminus K) \; d(x,y) < \delta_2 \implies |f(x)-f(y)| < \epsilon$$
Finally $\delta = \min(\delta_1, \delta_2)$ works.