A general way of expressing a four-current due to a single charge is:
$J^\mu\left(x\right) =qc\int d\tau \, u^\mu \delta^{\left(4\right)}\left(x-\bar{x}\left(\tau\right)\right)$
Where $q$ is the charge, $c$ is the speed of light, $\delta^{\left(4\right)}\left(x-\bar{x}\left(\tau\right)\right)=\delta\left(c\left(t-\bar{t}\left(\tau\right)\right)\right)\delta^{\left(3\right)}\left(\mathbf{r}-\bar{\mathbf{r}}\left(\tau\right)\right)$ is the 4d delta function, $\tau$ is the proper time of the particle and $\bar{x}^\mu=\bar{x}^\mu\left(\tau\right)$ is the world line of the particle. This should be your starting point, IMHO.
Also, accrding to my calculations:
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=q$
where $\gamma$ is the Lorentz factor of the charge. So maybe this is what you were looking for.
Still, your question was about how to deal with $f=f\left(\mathbf{r}-\bar{\mathbf{r}}\left(t\right)\right)$ (I hope you don't mind me changing notation slightly). Now you want to consider some boosted frame with coordinates $\{ct',\,\mathbf{r}'\}$. Clearly you will have a procedure for changin the coordinates from $S'$ to $S$: $t=t\left(t',\,\mathbf{r}'\right)$ and $\mathbf{r}=\mathbf{r}\left(t',\mathbf{r}'\right)$. Essentially, the inverse of what you wrote. Then your function in $S'$ is simply:
$f\,in\,S'=f\left(\mathbf{r}\left(t',\mathbf{r}'\right)-\bar{\mathbf{r}}\left(t\left(t',\mathbf{r}'\right)\right)\right)$
However you have to be careful. Just because the function is not a vector it does not mean it is a true scalar. For example $\delta^{\left(3\right)}$, i.e. the 3d delta-function, is actually a density, hence when you change coordinate frame you will get Jacobians coming out (hello length contraction). Also, you have to be careful with integrals $\int d^3 r\dots$ is an integral over 3d space that is perpendicular to temporal axis in the current refrence frame. In a different reference frame this 3d space will no longer be perpendicular to temporal axis, it could be partially spatial and partially temporal.
Following from the comments
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) \: \int cd\tau \: u^\mu\left(\bar{t}\left(\tau\right)\right) \delta^{\left(4\right)}\left(x-\bar{x}\left(\tau\right)\right))$
Expand the 4D delta function for the current observer. The world-line of the particle in the current frame is $\bar{t}=\bar{t}\left(\tau\right)$ and $\bar{\mathbf{r}}=\bar{\mathbf{r}}\left(\tau\right)$:
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \int cd\tau \: \delta\left(c\left(t-\bar{t}\left(\tau\right)\right)\right) u^\mu\left(\bar{t}\left(\tau\right)\right) \int d^3 r\, \delta^{\left(3\right)} \left(\mathbf{r}-\bar{\mathbf{r}}\left(\tau\right)\right) $
The last integral over the 3d delta function trivially vanishes so
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \int cd\tau \: \delta\left(c\left(t-\bar{t}\left(\tau\right)\right)\right) u^\mu\left(\bar{t}\left(\tau\right)\right)$
Next we change the integration variable: $\frac{d\bar{t}}{d\tau}=\gamma\left(\bar{t}\right)$. Clearly there is slight abuse of notation here, but since there is a bijective relationship between $\bar{t}$ and $\tau$, it is ok. So:
$\frac{1}{c^2}\int d^3 r\, \gamma\left(t\right) u_\mu\left(t\right) J^\mu\left(t,\mathbf{r}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \int \frac{cd\bar{t}}{\gamma\left(\bar{t}\right)} \: \delta\left(c\left(t-\bar{t}\right)\right) u^\mu\left(\bar{t}\right)=\frac{q}{c^2}\gamma\left(t\right) u_\mu\left(t\right) \frac{1}{\gamma\left(t\right)} u^\mu\left(t\right)=\frac{q}{c^2}u_\mu\left(t\right) u^\mu\left(t\right)=q$
Since $u_\mu u^\mu = c^2$ at all times