Suppose $f$ has your property but is discontinuous at $x=a$. Now for each $\delta > 0$, $f([a-\delta, a+\delta])$ is a connected compact set, and thus is an interval containing $f(a)$. Moreover since $f$ is discontinuous at $x=a$ there must be some $c \ne f(a)$ such that $f([a-\delta,a+\delta])$ contains both $f(a)$ and $c$ (and, since it's an interval, everything in between) for all $\delta > 0$. Then there is a sequence $x_n$ such that $|x_n - a| < 1/n$ and $f(x_n) = (1 - 1/n) c + (1/n) f(a)$. Then $K = \{a\} \cup \{x_n: n \in {\mathbb N}\}$ is a compact set, $c$ is a limit point of $f(K)$, but $c \notin f(K)$, contradiction.
EDIT: The question for functions $f$ from ${\mathbb R}^n$ to ${\mathbb R}^m$ also seems interesting. Suppose such an $f$ maps compact sets to compact sets and connected sets to connected sets, but is discontinuous at $a$. Let $B_\delta(p)$ be the closed ball of radius $\delta$ centred at $p$ and $S_\delta(p)$ the sphere of radius $\delta$ centred at $p$ (in either ${\mathbb R}^n$ or ${\mathbb R}^m$ depending on the context). There is $\epsilon > 0$ such that for all $\delta > 0$, $f(B_\delta(a))$ is not contained in $B_\epsilon(f(a))$. For every $r \in (0,\epsilon)$, since $f(B_\delta(a))$ is connected, $f(B_\delta(a)) \cap S_r(f(a))$ must be nonempty. In particular we can take $x_n$ with $\|x_n - a\| \le 1/n$ and $\|f(x_n) - f(a)\| = (1-1/n) \epsilon$. Again we get a contradiction, taking $K = \{a\} \cup \{x_n: n \in {\mathbb N}\}$.