Can be taken day or night. Usually a combination of a fast shutter speed and small aperture and having an open water background behind the subject, which won't reflect the light from the flash (which is of course providing the colour on the subject).
On a DSLR it is actually much easier to take a black background that a blue one. Typically settings for macro would be F16 @ 1/125th - which would produce a black background in typical. To get a blue background you need to sacrifice either aperture (loose depth of field) or shutter speed (risking blury images), or a bit of both, or these days bump the ISO.
On a compact camera its is generally easier to get blue backgrounds. Partly this is because not all camera's offer manual control over shutter speed and aperture. Also most compacts cannot stop down past F8, so you need a shutter speed of at least 1/250th (1/500th is better) to get a black background. At more normal "automatic" settings you are likely to get a blue background on macro with a compact.
If you don't have manual control on your compact then night or deep dives might be the best solution.
Alex