Tail light wiring/earth fault. Probably as the loom passes from the body to the bootlid
Almost certainly unless this concerns an estate?
You'll have to remove the wrapping on the wire loom by the hinge where it flexes to expose the wires. With a bit of luck the broken wire(s) will be easily visible. However the wrapping will disintegrate into small fragments. So you'll need some black cloth tape.
To fix it's best not to simply splice or otherwise bridge the break. The hinging and flexing from opening and closing the boot will break it again. Instead cut out the broken sections either side of the break, to a total of 4-6 inches or so, and insert a new piece of wire of the same gauge. The objective is that the hinging and flexing now occurs on a new piece of wire and the joins are in a static section of the loom.
If more than one wire is broken, usually there's two, then stagger the joins as you need the re-wrapped loom to be be as slim as possible so as not to foul the boot and it's seal when closed.
Black cloth tape for wrapping can be had from Toolstation, Screwfix, electrical wholesaler or your friendly local motor factor etc.