Does every locally compact group $G$ have a nontrivial homomorphism into $\mathbb{R}$? 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}$.
 A: 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. 
A: For a connected example one can take $G=\mathrm{SL}_2(\mathbb{R})$ (or any connected simple Lie group). If $f:G\to \mathbb{R}$ is a continuous homomorphism then $f(G)$ is a connected simple subgroup of $\mathbb{R}$, hence trivial.
EDIT: I see now someone already mentioned this in the comments.
A: Suppose that $G$ is a locally compact group with Property FH. Then, every continuous homomorphism from $G$ to $\mathbb{R}^n$ or $\mathbb{Z}^n$ is trivial. 
This follows from a corollary in the book "Kazhdan's Property T" by  Bekka, de la Harpe and Valette. 
