Some nitpicks on Lorentz invariance I'm trying to understand the exact mathematics of Lorentz invariance and I have a question. I hope this is a good place to ask.
To prove that $J^\mu dt=\rho dx^\mu$ defines a $4$-vector, my book says that for a small charged particle occupying the volumes $dV$ with charge density $\rho$ in a certain referential $R$, the quantity $dq=\rho dV$ is evidently a Lorentz scalar, hence, with obvious notations, in a certain referential $R'$ we have $\rho dV = \rho'dV'$. I'd like to make sure I understand what this means, formally. 
Let's forget this particular setting and suppose $\rho$ is just the  density of charge in the entire universe, as in the Maxwell equations for instance.  Now let $M$ be the Minkowski space-time and $G$ the Lorentz group, acting on $M$. Formally one can think of $\rho$ as a function $M \to \mathbb{R}$. Am I right in saying that what is meant is generally that $g \in G$ acts on such functions $f : M \to \mathbb{R}$ by $(gf)(x)=f(g^{-1}x)$ , or, in this particular case, that $\rho'$ is gotten from $\rho$ by precomposing with the inverse of the Lorentz transform going from the basis corresponding to $R$ from that corresponding to $R'$?
Now this doesn't really make sense here: $dq$ is a scalar, $dV$ is, too, so $\rho$ can't be a function, so what is meant is surely that there is a constant $C$ and the function $\rho$ as in the preceding paragraph is exactly constant and equal to it in the region $dV$ and null outside of it. Since $dV'$ can have a different shape, $\rho'$ is a function equal to a possibly different constant $C'$ in the region $dV'$ and, likewise, null outside of it. The first equality is then to be understood as $CdV$=$C'dV'$.
This is not really a question about relativity especially, since the same problem happens with just classical space translations (you can't have $f(x)=f(x-x_0)$ if $f$ is nonzero only on a small particle).
 A: Lorentz transformations don't act on spacetime itself - they act on coordinates.
Formally, given an open neighborhood $U\subseteq M$ and a coordinate chart map $x:U \rightarrow V \subseteq \mathbb R^4$, a function $f:M\rightarrow \mathbb R$ induces a function $f_x:V \rightarrow \mathbb R$ via
$$ f_x(a,b,c,d) = (f\circ x^{-1})(a,b,c,d)$$
The distinction is crucial - $f$ is a function on spacetime, whereas $f_x$ is the chart image of $f$ in the chart $(U,x)$.  A Lorentz transformation is a change of chart, which means that at the manifold level it does nothing at all.
That is, a Lorentz transformation is a linear coordinate transformation from a chart $(U,x)$ to another chart $(U,y)$, where
$$y^\mu = (y\circ x^{-1})^\mu =\Lambda^\mu_{\ \ \nu} x^\nu$$
Accordingly, the chart representation of $f$ transforms as follows:
$$f_y = f\circ y^{-1} = f\circ (x^{-1} \circ x) \circ y^{-1} = f_x \circ (x\circ y^{-1})$$
and so 
$$f_y ( a,b,c,d) = f_x\big( \big(\Lambda^{-1}\big)(a,b,c,d)\big)$$
This is typically expressed as $f'(x) = f(\Lambda^{-1} x)$.

Now to more directly address your question.

Formally one can think of $\rho$ as a function $M\rightarrow \mathbb R$

The charge density $\rho_{(x)}$ is a function which lives in a chart.  It is not clear whether it can be "lifted" to the manifold level, and in fact in this case it cannot. 
The reason for this is that $\rho_{(x)}$ is not Lorentz-invariant.  Consider some total charge $Q_{(x)}$ uniformly distributed in a stationary box of volume $V_{(x)}$, where the subscript $(x)$ refers to the chart that we are working in.  The charge density inside the box is $\rho_{(x)} = \frac{Q_{(x)}}{V_{(x)}}$.  If we boost to another frame with coordinates $y$, then $V_{(y)} = V_{(x)} \sqrt{1-\frac{v^2}{c^2}}$ where $v$ is the speed of the second reference frame with respect to the first; this is the Lorentz contraction effect.
If we further suppose that $Q_{(y)}=Q_{(x)}$ (i.e. that electric charge does not change under Lorentz transformations$^\dagger$), then it follows that
$$\rho_{(y)} = \frac{\rho_{(x)}}{\sqrt{1-\frac{v^2}{c^2}}}\equiv \gamma \rho_{(x)}$$
Or, to use the notation from before,
$$\rho'(x) = \gamma \rho\big(\Lambda^{-1} x\big)$$
This is different from the transformation law one obtains for the chart representation of a function $M\rightarrow \mathbb R$, so evidently $\rho_{(x)}$ cannot be lifted to well-defined function at the manifold level - that is, it is not a Lorentz scalar.

We can go a step further.  Note that if a vector field $\mathbf V$ is defined at the manifold level, it takes the following form in a chart $x$:
$$\mathbf V = V^\mu_{(x)}(x) \frac{\partial}{\partial x^\mu}$$
Making the same transition as before, we note that 
$$\frac{\partial}{\partial y^\mu} = \frac{\partial x^\nu}{\partial y^\mu} \frac{\partial}{\partial \nu} = \big(\Lambda^{-1}\big)^\nu_{\ \ \mu} \frac{\partial}{\partial x^\nu}$$
and so
$$\mathbf V = V^\mu_{(y)}(y) \frac{\partial}{\partial y^\mu} = V^\mu_{(y)}\big(\Lambda^{-1}\big)^\nu_{\ \ \mu} \frac{\partial}{\partial x^\nu}$$
$$\implies V^\mu_{(y)}(y) = \Lambda^\mu_{\ \ \nu} V^\nu_{(x)}\big(\Lambda^{-1} y\big)$$
which means that components of vector fields transform as
$$(V')^\mu(x) = \Lambda^\mu_{\ \ \nu} V^\nu\big(\Lambda^{-1} x\big)$$
under Lorentz transformations.  Comparing this to the above expression for $\rho$, we note that $\rho$ transforms like the time component of the four vector field $J^\mu_{(x)} = (c\rho_{(x)}, 0,0,0)$, which motivates the definition of the 4-current.

$^\dagger$ It would not be unreasonable to feel that this step is unjustified, and from a certain standpoint it is.  However, by making this postulate and working under the assumption it is true, then we arrive at results which work beautifully and match all experimental measurements.
