Are compact spaces the only spaces with locally compact continuous images? Let $X$ be a topological space such that for every continuous map $f: X \to Y$, $f(X)$ is locally compact. Must $X$ be compact ?
(It would therefore characterise compact spaces.)
If possible, I would prefer a constructive proof/counterexample.
 A: Here is a partial answer:
If $X$ is T2, and each T2-image of $X$ is locally compact, then $X$ is locally compact, normal and countably compact.
Proof.
As was observed by Randall, of course, $X$ is locally compact, hence regular.  
(a) $X$ is normal: Let $A, B$ be disjoint, closed subsets of $X$. Consider the quotient space $X/A$, where the points of $A$ are identified. Since $X$ is regular, $X/A$ is T2, hence locally compact, hence regular. The quotient map $\lambda: X \rightarrow X/A$ is closed, hence $\lambda(B)$ is closed in $X/A$. Hence $\lambda(B)$ and the one-point $A$ can be separated in $X/A$, hence $A, B$ can be separated in $X$.  
(b) If $X$ is a subspace of the reals, then $X$ is bounded:
(This is essentially the same argument as Engelking 1.4.17.)
Assume not, w.l.o.g let X be unbounded above. Then there is a strictly increasing sequence $(x_n)_{n \in \mathbb{N}}$ in $X$ with $n < x_n$ for all $n$. Hence $A := \{x_n: n \in \mathbb{N}\}$ is closed in $X$. As above, $X/A$ is locally compact, hence has a countable base (see Engelking 3.3.7). In particular, there is an open neighborhood base $(U_n)_{n \in \mathbb{N}}$ of the point $A$ in $X/A$. Again, let $\lambda: X \rightarrow X/A$ be the canonical map.
Let $n \in \mathbb{N}$. There exists $n < u_n \in \lambda^{-1}(U_n) \setminus A$.
[If not, then $A^{>n} = \lambda^{-1}(U_n) \cap \mathbb{R}^{>n}$ is infinite, discrete and clopen in $X$, hence there is a continuous, surjective map $f: X \rightarrow \mathbb{Q}$. Contradiction!] 
$B := \{u_n: n \in \mathbb{N}\}$ is closed in $X$, $A \subset X \setminus B$, hence $\lambda(X \setminus B)
$ is an open neighborhood of the point $A \in X/A$. Hence there exists an $n \in \mathbb{N}$ such that $U_n \subset \lambda(X \setminus B)$. Contradiction! 
(c) $X$ is pseudocompact: By (a) $X$ is completely regular. Let $f: X \rightarrow \mathbb{R}$ be a continuous map. By (b) $f(X)$ is bounded. 
(d) $X$ is countably compact: (a) and (c) (see Engelking 3.10.21).
Remarks:
Note that countably compact, locally compact, normal spaces are quite close to compact spaces.
The standard counter-example is $\omega_1$, which $almost$ fullfills this condition, namely, all completely regular images of $\omega_1$ are locally compact. Would be interesting to know, what's about the other images. I assume that a proof that $\omega_1$ does not fullfill this condition would yield a proof of the OP's assumption. On the other hand, a proof that $\omega_1$ fullfills the condition would then provide a counter-example.
