Does electric charge vary between observers? I understand that certain observations such a length and mass vary depending on observers in different frames of motion and gravity.  I was wondering if the electric charge changes in a similar way.  I was of the impression that this cannot be the case because of the iron-clad law of conservation of charge, yet I discovered there are formulae that seem to link charge to the speed of light.  If the speed of light slows in a gravitational field would that imply that gravity also would change charge?
 A: The core of the issue is the determination of inertial frames, where an inertial frame is defined as being a frame in which the laws of mechanics are the same. But, which laws? If it is Newtonian Mechanics then the Galilean transformation will shift from one frame in which Newtonian Mechanics works to another. 
But, when electromagnetic theory is considered the Galilean transformation is wrong, it does not preserve Maxwell's equations. 
The Lorenz transformation is one that does. 
https://en.wikipedia.org/wiki/Lorenz_gauge_condition
But, there are many other options. 
https://en.wikipedia.org/wiki/Gauge_fixing#Coulomb_gauge
The choice between them is the matter of a choice of a scalar gauge field. The Lorenz transformation is the one that also preserves the charge density.
To put a bit of context there, while a moving observer sees the equations of electromagnetic theory to be unchanged, they nevertheless see different electric and magnetic fields. In the general case of transformations that preserve the equations, the charge density - treated simply as a field of real numbers - also changes. 
The Lorentz transformation is the gauge choice that preserves the speed of light. And it also preserves the charge density. This is not a coincidence, as there is, in the general case, a relation between the charge gauge (interpreted here as the charge on the electron, for example) and the speed of light.
Accelerating frames are more of a problem. You cannot preserve the electromagnetic equations in an accelerating frame. In physical terms, it is not inertial - so we should not expect the equations to be the same. This leads to interesting conundrums, paradoxes, and controversies. 
If an accelerating electron radiates, does it radiate in its own frame? Since gravity is equivalent to acceleration, should not an electron held stationary on the surface of the Earth radiate - due to that acceleration?
https://en.wikipedia.org/wiki/Paradox_of_radiation_of_charged_particles_in_a_gravitational_field
A: Charge is Lorentz invariant, meaning it is the same in all frames of reference. This means that four current is a four vector. This is because, for example, the time-like component is charge density, $\rho =\frac{dq}{dV}$. Because length only contracts in the direction of relative motion, volume only decreases by a Lorentz factor, the same as length. If charge is a scalar the  charge density transforms as a component of a four vector. This gives Maxwell's equations their relativistic form
I can't speak with certainty but I imagine it is invariant under diffeomorphisms in general relativity too.
A: I would a give widespread example, probably mentioned in Griffith. Electric charge is invariant under Lorentz transformation. Take Helium atom, for example; the electrons are moving in relativistic speed. If charge was varient then the net charge of atom would been positive (not neutral).
A: You seem to have two questions here; I'll answer them both in turn.
I) Is the charge of a particle dependent on its speed?
No, it is not. The charge of a particle stays the same no matter what speed it is going at. However, the fields produced by the particle do change depending on the speed which one is moving, which are probably the source of the formulae you found. Charge doesn't change upon movement to a boosted inertial frame, but the fields the charges produce may. It will all produce the same equations of motion in the end, however. If you are familiar with the theory of tensors, one can find how to transform it quite easily using the electromagnetic field tensor, defined as
$$F^{\mu\nu}=
\begin{pmatrix}
0 & E_x/c & E_y/c & E_z/c \\
-E_x/c & 0 & B_x & -B_y \\
-E_y/c & -B_x & 0 & B_x \\
-E_z/c & B_y & -B_x & 0
\end{pmatrix}$$
To find new components of the transformed tensor, simply use $$F^{\rho\sigma}=\Lambda^\rho_{\;\mu}\Lambda^\sigma_{\;\nu}F^{\mu\nu}$$
where $\Lambda^\alpha_{\;\beta}$ is the matrix describing the Lorentz transformation you want to use.
II) Does gravity change charge?
No. Again, the fields produced by a charge may change, but the charge of a particle is absolute. The electromagnetic field transforms and evolves in an incredibly complicated and nonlinear way in general relativity (more information here), but the charge of the objects remains the same.
A: The above answers seem to nicely summarize why charge is conserved in every frame of reference. I would like to take a different approach as to why that makes sense, and why the charge conservation law holds.
1. Charge, current and conservation:
The most simplest way to state the conservation of charge is to say, $$\frac{dQ}{dt} = 0$$
That the rate of change of charge in time is $0$, implying that the quantity of charge is a constant.
But, sometimes charge can decrease in a system. This does not violate the supreme principle, but rather states that charge can 'leak' or flow through an area, causing the charge in the system to decrease, and the charge outside to increase. So, the amount of charge in the entire universe is the same, but for smaller systems the above equation may not hold true.
Consider a box with some charge inside of it. The charge can flow out through any of the faces of the box, thus decreasing the overall charge inside (it can also increase if the charges are instead entering the box). So, you need to take into account this flow of charges, called a current to make sure that the conservation law holds. The resulting mathematical form is:
$$\frac{d\rho}{dt} + \nabla . J^i = 0$$
where the $\rho$ represents the density of charge inside the box, and $J^i$ is the current vector, because current can flow through the $x$, $y$, and $z$ axes; so we use a vector to keep track of them all. What the above expression says is: the rate of change of charge in the box and the rate of change of current flowing in or out of it, is going to be conserved.
2. Four vectors, dot products and Lorentz invariance:
In Relativity, we use something known as four-vectors, which are 4 dimensional vectors. Usual vectors have only three components: one corresponding to each dimension of space; in Relativity, we consider a fourth dimension: time. So, vectors in Relativity have four components, one corresponding to time, and three to space. We denote these vectors by $$A^{\mu}, \mu = (0, 1, 2, 3)$$
where the $0$ index corresponds to the time component and the other three to the space components.
Now, let's move on to Lorentz invariance. In Special relativity, whenever we want to consider events from a different reference frame, we use something known as Lorentz transformations. I am going to leave a few nice resources in the further reading below, but for now, that is enough information.
If a certain quantity does not change when the Lorentz transformation is applies to it, we say it is Lorentz invariant.
So, some of the things that are always Lorentz invariant are the dot product between two four-vectors. Again, for length purposes, I will leave a link to some resources below, but simply put, dot products between two vectors can be denoted as: $$Product_{dot} = A^\mu B_\mu$$
The only constraint is that the index of the four vectors should be the same and they should be repeated upstairs and downstairs. Expanding this expression, we get: $$A^{\mu}B_{\mu} = -(A^0 B_0) + (A^1 B_1) + (A^2 B_2) + (A^3 B_3)$$
which is a scalar and is Lorentz invariant. These scalars are called Lorentz scalars.
3. Bringing it all together:
In Special Relativity, we denote the charge and current of a particle as a four vector $J^{\mu}$. The time component is $\rho$ and the space components are $J^i$. There is another four vector $\partial_{\mu}$ which is defined to be: $$\partial_{\mu} = \left  (\frac{\partial}{\partial t}, \frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \frac{\partial}{\partial z}\right)$$
Okay. Now, particles have some properties, like mass and charge that do not change when you shift frames. Similarly for the conservation of charge, you can write it as $$\partial_{\mu}J^{\mu} = 0$$
which is a dot product, so it is naturally a Lorentz invariant.
4. So, can charge vary for observers?
I took an unconventional way of answering here, by first showing the true way of expressing the conservation of charge and then going through a long way to show why the law hold even when our frames change.
By doing this though we can mathematically say, that charge cannot vary with respect to observers. We can be sure about this, because the conservation of charge holds, whatever the situation.
Going back to the box situation, imagine that there is no current, or flowing charges at all. Then, by the proof of the fundamental upholding of the charge conservation law, we can clearly agree that the charge does not depend on observers. Rather than just stating it up, we derived that answer as a consequence of the conservation law. If you try and negate the answer, then you would get a contradiction between the above proof, one of the most fundamental laws of Nature, and your new results. If the conservation law stays put, so does the charge; it has to.
Further Reading:
One of my answers with a lot of ore stuff on four vectors, and Lorentz invariance; it also shows why mass is an invariant: Why is mass an invariant in Special Relativity?
More about four-vectors in relativity: http://hyperphysics.phy-astr.gsu.edu/hbase/Relativ/vec4.html
And a brilliant introductory series on the topic of vectors by 3Blue1Brown: https://www.youtube.com/watch?v=fNk_zzaMoSs&list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab
Some more on conservations: https://en.wikipedia.org/wiki/Continuity_equation#General_equation
More on Einstein summation notation: https://mathworld.wolfram.com/EinsteinSummation.html and https://en.wikipedia.org/wiki/Einstein_notation
Lorentz transformations: https://en.wikipedia.org/wiki/Lorentz_transformation and https://www.khanacademy.org/science/physics/special-relativity/lorentz-transformation/v/introduction-to-the-lorentz-transformation
Dot products: Question about dot product of four vectors? and https://www.youtube.com/watch?v=eyxC4YJ0YH0
A: A lot of people have already pointed out how charge is conserved locally in special relativity. Conservation of charge is just an application of Noether theorem (must have a equation of form $\partial_{\mu}J^{\mu}=0 $) so if we're giving description of a phenomenon and we don't have a continuous global symmetry then we can say goodbye to our iron-clad conservation of charge law. When we talk about conservation of electric charge we have at our disposal Maxwell equation (which describe Electromagnetism) and Minkowski or Curved background.
For Minkowski the derivation (which I like) is as follows $$\partial_{\nu}F^{\mu\nu}=J^{\mu}$$
$$\implies\partial_{\mu}J^{\mu}=0$$
because of antisymmetry property of $F^{\mu\nu}$. Now $Q$, the charge which will be conserved is $\color{red}{defined}$ as$$Q=\int d^3xJ^0$$
if you take its derivative $$\frac{dQ}{dt}=\int d^3x\frac{\partial J^0}{\partial t}$$
$$=\int d^3x\hspace{4pt} \partial_iJ^i$$
applying gauss theorem $$\oint dA_i\hspace{2pt} J^i$$
which vanishes because $J$ goes to zero at large distance and $dA_i$ is normal surface element at the boundary of $R^3$.
Main reason why I provided above derivation is because of its close parallel to the derivation in curved background. Now Maxwell equation in curved sptm is given by $$\nabla_\nu F^{\mu\nu}=J^{\mu}$$
where $\nabla$ is our covariant derivative. Here proving $\nabla_{\mu}J^{\mu}=0$ goes by different route than SR since there partial derivatives commute. We just have to use the commutator of covariant derivative along with the antisymmetric property of $F^{\mu\nu}$
$$[\nabla_\mu, \nabla_\nu]F^{\mu\nu}=R^{\mu}_{\alpha\mu\nu}F^{\alpha\nu}+R^{\nu}_{\alpha\mu\nu}F^{\mu\alpha}$$
after manipulating above equation we get $$\nabla_{\mu}\nabla_{\nu}F^{\mu\nu}=R_{\alpha\beta}F^{\alpha\beta}$$
The RHS of above equation vanishes because $R_{\mu\nu}$ is symmetric while $F^{\mu\nu}$ is antisymmetric thus giving us the desired result of $\nabla_{\mu}J^{\mu}=0$. In SR derivation we used $\int d^3x$ to define $Q$ here we use a spacelike hypersurface $\Sigma$. Now $Q$ is defined as $$\int d\Sigma_a J^{a}$$ why? because it is then a constant. Here why is it so $$\nabla_{\mu} J^{\mu}=0$$ $$\implies\oint d\Sigma_{a} J^{a}=0$$ if $J$ goes to zero at spatial infinity then two spacelike hypersurface can be chosen such that above integral becomes $\int_{\Sigma_1}d\Sigma_{a}J^a-\int_{\Sigma_2}d\Sigma_{a}J^a=0$ which by our definition is just $Q-Q=0$ thus Q is conserved and this is what we call the electric charge in GR. There is another way of writing $Q$, $$Q=\oint_S F^{\mu\nu}dS_{\mu\nu}$$ here we have used Maxwell equation followed by another stokes theorem. $S_{\mu\nu}$ is the directed two surface boundary of $\Sigma$. $Q$ is conserved because we have define it to be that way. Judging by your question I think you might have come across formulae for speed of light in a medium and how it is related to the free charge of the medium so it might be confusing you. But note the speed of light there is determined by the charge provided by the boundary so if the speed is different you can infer there is some change in the charge at the boundary but it doesn't mean charge is not conserved. A much stronger statement to say when our system is isolated is this since we know charge is conserved and we also know charge at the boundary of the medium is less or more than by conservation of charge the influx or the outflux has to be present somewhere within the system. This is the power of conservation laws.
Further comments on conservation of electric charge. When dealing with classical system conservation of charge is guaranteed because we get $$\partial_{\mu}J^{\mu}$$ in some way or the other because of Maxwell Equations we don't have into dwell into Noether theorem. When we go for QFT and use Lagrangian density formalism electric charge is conserved charge(charge which appears in Noether theorem can as well be energy, momentum something which doesn't change with time(when I picked the term time I have lost the covariance of GR where the formulation is different)) related to the global continuous symmetry of the Lagrangian, $$\mathcal{L}=-\frac{1}{4}F^2_{\mu\nu}+i\bar{\psi}\not\!{D}\psi-m\bar{\psi}\psi$$ is invariant under the transformation $$\psi\rightarrow e^{-i\alpha}\psi$$ where $\alpha$ is a constant. Associated with this symmetry is our electrical charge given by $$Q=\int d^3x J_0$$ where $$J_0=\psi^{\dagger}\psi$$ and associated current is $$J_{\mu}=\bar{\psi}\gamma_{\mu}\psi$$ There is another way to get conservation of electric charge using only Lorentz invariance and soft limit of photon.
It basically goes like following

*

*You tack on photon on external legs of Feynman diagram and then take soft limit of photon which means its 4-momentum satisfies $E^2=|\vec{p}|^2$ and E can be made as small as possible

*We then take Lorentz transformation and see how polarisation vectors transform.

*Making similar argument as coming up with Ward's identity and we get the result of charge is conserved in an interaction.

Even though we have charge conservation in QED but when we do renormalization of QED it's non trivial fact that charge conservation still survives for example anomaly (symmetries which are present in classical lagrangian but when we construct quantum theory of them the
symmetry doesn't survive) to read further about how charge is conserved even after renormalization you can refer to Schwartz paragraph just below $(14.143)$.
Further reference:

*

*Relativistic toolkit

*QFT Schwartz

