I have a mesh with multiple vertex groups and shape keys, and I need to increase topology. I'm using blend4Web, which doesn't export modifiers, therefore one should apply them to realize their effect. So my question is is there any way to increase topology in edit mode without messing up the shape keys and vertex groups?
Dissolve X, Vertex Connect Path J, Knife Topology Tool K
With the Basis key active and all other keys set to 0.0, these operators allow me to thoroughly retopologize a character model (~18,000 vertices) and maintain shape key deformation and vertex weights long after rigging and adding almost one hundred shape keys. They use the current surface detail of the mesh to retain shape key/vertex group information, as opposed to destructive operators like Delete which have tendencies force a global recalculation of surface detail.
This is probably not a solution to the OP's problem but I post it anyway for the benefit of others who might stumble across this quesion looking for ways to manually add geometry to meshes with existing shape keys (i.e. not by applying modifiers):
I found that modifying the geometry of a mesh with existing shape keys can indeed be done under certain circumstances, i.e. if the new geometry is located in an area of the mesh that is not affected by the existing shape keys.
In that specific case you can define a vertex group that excludes the area of the new geometry and use it to restrict the shape keys' influence via the "Blend" option on each shape key. This way you can modify topology as much as you like as long as you keep away from that vertex group. I also recommend sticking to non-destructive mesh operators like the ones that @Michael pointed out in his answer, though.
I frequently do this with character meshes created with ManuelBastioniLab which come with a bunch of shape keys for facial expressions (and more recently also breathing and swallowing). With the above trick I can still add fantasy body extensions like spikes, tails or wings without having to sacrifice the shape keys. However, it would not work if I wanted to add geometry to the face, neck or chest areas.
Use a subsurface modifier. You can then apply modifiers without losing shape keys in one click using this little helper:
(I guess it is for older blender versions, because I had to rename its files to match conventions of blender 2.79 but it works perfectly.)