Does every locally compact group (second countable and Hausdorff) topological group $G$ that is not compact have a nontrivial continuous homomorphism into $\mathbb{R}$?
Obviously for compact groups it is not possible since continuous functions send compact sets to compact sets, and there is only one (trivial) compact subgroup of $\mathbb{R}$.
Suppose $G$ is infinite, discrete, and every element has finite order. Then any homomorphism $h : G \to \mathbb R$ would map each element to something of finite order since $h(g)^n = h(g^n) = h(e)=e$ for some positive $n \in \mathbb N$. But only the zero element of $\mathbb R$ has finite order. This implies $h$ is the trivial homomorphism. An example of such a $G$ is the group of all permutations of $\mathbb N$ that fix all but finitely many elements.