A situation recently came up in my weekly game where a PC who had just discovered a new magic item after a series of encounters took a short rest to identify the magic item's properties. Per the DMG, this is all that is needed to identify a magic item's properties so there's nothing wrong with that.
The magic item required attunement, so I told him it was useless to him until he attuned with it. He asked for the rules on attunement and I told him it requires another short rest. No further short rests came up during that adventuring day, so the party decided to set up camp.
The question came up, "Can I attune during a long rest?"
I determined based on the following excerpt from the DMG that the answer to that question is no:
Some magic items require a creature to form a bond with
them before their magical properties can be used. This bond is called
Attuning to an item requires a creature to spend a short rest focused
on only that item while being in physical contact with it (this can't
be the same short rest used to learn the item's properties). This
focus can take the form of weapon practice (for a weapon), meditation
(for a wondrous item), or some other appropriate activity. If the
short rest is interrupted, the attunement attempt fails. Otherwise, at
the end of the short rest, the creature gains an intuitive
understanding of how to activate any magical properties of the item,
including any necessary command words…
So, naturally, the player said, "Okay, I take a short rest just before the long rest."
Something about this really doesn't sit well with me but I can't find a reason in the rules for not allowing this. Obviously it's not the intended usage of rests (short or long) based on the adventuring day, but I really didn't have any good rationale behind disallowing the short-then-long rest.
For reference, I have included the pertinent rules relating to short rests and long rests below.
A short rest is a period of downtime, at least 1 hour long,
during which a character does nothing more strenuous than eating,
drinking, reading, and tending to wounds…
A long rest is a period of extended downtime, at least 8
hours long, during which a character sleeps or performs light
activity: reading, talking, eating, or standing watch for no more than
A character can't benefit from more than one
long rest in a 24-hour period…
It should be fine, as long as time allows.
Nothing in the rules says that a long rest cannot immediately follow a short rest. In this case, what the characters are doing during those rests are very different.
Indeed, a short rest and a long rest are what many real-life people do before bed: an hour or so of non-strenuous activity, like reading, and then going to sleep. It's not a stretch to say that a D&D character can't spend an hour studying their magical item, and then go to sleep.
The only time where that might be a problem is if the characters don't have the full 9 hours.
Different things are happening during the two rests.
What's really key here is that the activities during the two rests are different. In the short rest portion, the character is studying the magic item, meditating on it, or whatever is required for attunement. In the long rest portion, the character is doing something else, such as sleeping. The attunement process is still active work, just not active relative to adventuring.
I think that this distinction is why attunement is limited to short rests, and why a character should be able to do chain them together.