In Civ V you can't have two military units on top of each other, but it's ok to have a military unit in the same hex as a worker or settler to guard them. The thing is, I have to move the settler and the military unit separately and make sure they end up on the same hex every turn. Is there a way to automatically group them together, so that I don't accidentally leave my settler or worker unguarded?
There is one way that works when moving a civilian unit a great distance, such as a settler moving to a new place.
Start with your worker and your military unit in the same hex, with the same number of movement points. Then you can assign each unit to move to the same target hex, and they will take the same path there.
This will only work if the two units move the same way, such as a standard melee unit (2 moves/turn) and a standard settler (2 moves/turn). If the melee unit is an upgraded scout, or otherwise has a different way of moving, then the two units will become separated. This can also happen if there's anything in the way that would block one of the units, but not the other. (Such as an allied military unit that your civilian can't move through. Or if your pair of units would end their turn on a hex with a worker on it, then the civilian will stop elsewhere for the turn and your pair of moving units will forever be separated.)
This way of moving is unreliable, given the number of ways it can fail, but if you care about ease-of-use more than you care about reliability, it'll do for now.
I have read all of the relevant sections of the CIV 5 manual in PDF form. I have experimented with every possible button in the user interface while military units are in the same hex as settlers/workers. There does not appear to be a way to automatically group the units together for defense. You have to do it manually, at least for now. Hopefully this will change with patches, or at least a mod.