Surjective homomorphisms $\text{Homeo}(S^n) \to \mathbb{R}$? I am wondering if there are any continuous surjective homomorphisms $\text{Homeo}(S^n) \to \mathbb{R}$ for any $n$?  What about dropping the condition on continuity of the surjection?
Similarly, I would like to know the answers to the same questions with $\text{Homeo}(S^n)$ replaced by $\text{Diff}(S^n)$.  
 A: Consider the case of the group of diffeomorphisms $Diff(S^n)$ (which I understand to be $C^\infty$ with $C^\infty$ topology). The identity component $Diff_0(S^n)$ is known to be perfect, i.e. has trivial abelianization. I am not sure who was the first to prove it but for arbitrary manifolds this is due to Thurston. See here for a short proof: 
K. Mann, A short proof that $Diff_c(M)$ is perfect, New York Journal of Mathematics, 22 (2016) p. 49-55.  
The quotient group $\Gamma_n=Diff(S^n)/Diff_0(S^n)$ is known to be finite if $n\ne 4$ (Kervaire and Milnor for $n\ge 5$, Cerf for $n\le 3$ ($\Gamma_n\cong {\mathbb Z}/2$ for $1\le n\le 3$). In particular, every homomorphism to $Diff(S^n)\to {\mathbb R}$ is trivial. 
I am not sure how much is known in dimension 4 (I think, finiteness is unknown), but it is at most countable (see below). Thus, $Diff(S^4)$ has at most countable abelianization and, hence, cannot have an epimorphism to ${\mathbb R}$ either. 
Regarding the group of homeomorphisms, as Yves (YCor) noted, in his appendix to 
D. Calegari and M. Freedman, Distortion in transformation groups, Geometry and Topology, 2006
it is proven that $Homeo(S^n)$ is strongly bounded, i.e. whenever it acts isometrically on a metric space, it has bounded orbits. Since a homomorphism $Homeo(S^n)\to {\mathbb R}$ would define an isometric action (by translations) on the real line, it follows that every such homomorphism is trivial.  
Edit. 
Lemma. If $M$ is a compact smooth manifold then $Diff(M)$ (with its $C^\infty$-topology) is separable, i.e. contains a countable dense subset. In particular, $Diff(M)$ has (at most) countably many components. In other words, $Diff(M)/Diff_0(M)$ is (at most) countable. 
Proof. $Diff(M)$ is a subspace of $C^\infty(M,M)$. Hence, it suffices to prove separability of the latter. Embed $M$ (smoothly) in some ${\mathbb R}^N$. Then  $C^\infty(M,M)\subset C^\infty(M, {\mathbb R}^N)$. Thus, it suffices to prove separability of the latter. Since $C^\infty(M, {\mathbb R}^N)$ is a direct sum of $N$ copies of $C^\infty(M)$, it suffices to prove that the latter is separable. By (a version of) the Weierstrass Approximation Theorem, see e.g.  
Chapter 1 in "Approximation of Continuously Differentiable Functions," Volume 130  of North-Holland Mathematics Studies, 1986.
restrictions of polynomial functions are dense in $C^\infty(M)$. Lastly, polynomials with rational coefficients are dense among polynomial functions (where the $C^\infty$-topology is understood to be uniform on compacts). Separability follows. qed 
Remark. Separability of $C^\infty(M)$ for smooth manifolds should be a standard textbook reference, but I could not find one (with a proof). Hirsch in his "Differential Topology" states it without a proof.  A proof might be in one of P.Michor's books...
