How do you determine the gender of a dragon, without resorting to asking them? A number of published D&D adventures have dragons in them that are clearly identified as male or female. However, there is no information on how people know the gender of a dragon. I'm asking about the Forgotten Realms, as the original silver sourcebooks define dragons differently from the D&D 1E Monster Manual. Given the detail dedicated to dragons, there should be a gender determination description somewhere.
You should still ask them.
If you are in a position to ask a dragon without being roasted, dragons are sentient persons and deserve as much respect as you would give any other person. There may be cases where their gender identity does not match their biological sex, so you should ask politely to be sure.
I like the idea of a quest involving a dragon that's so tired of being misgendered for 500 years they've taken to terrorizing the region, and can be pacified by educating the populace about respect.
For biological sex, you can probably check the hardware.
The reproductive anatomy is, to my knowledge, never described in great detail, but the Dragonomicon for 3rd Edition has some details about the reproduction of dragons that leads me to believe a hardware inspection can tell you the sex of the dragon.
On page 10 we see:
A female dragon can produce eggs beginning at her young adult stage and remains fertile though the very old stage. Males are capable of fertilizing eggs beginning at the young adult stage and remain fertile through the wyrm stage.
The eggs are fertilized inside the female’s body and are ready for laying about a quarter of the way through the incubation period, as shown on the table below. The numbers given on the table are approximate; actual periods can vary by as much as 10 days either way
Fertilization inside the female's body means that penetrative intercourse is likely the method employed, so an inspection of the dragon's anatomy will likely tell you what sex you're dealing with. Again, the details of this anantomy are never explained, so your mileage may vary.1
Eggs usually means the lair of a female dragon.
On page 11, we see:
Most dragon eggs are laid in a nest within the female’s lair, where the parent or parents can guard and tend them.
So the female dragon typically lays her eggs in her own lair, but her mate is also likely to be around:
Dragons sometimes leave their eggs untended. In such cases, the female takes great care to keep the nest hidden. She or her mate (or both of them) may visit the area containing the nest periodically, but they take care not to approach the nest too closely unless some danger threatens the eggs.
In contrast, older dragons are sometimes known to lay their eggs in the lair of the male (page 27):
Older dragons are the most likely to mate and then raise their young on their own, and even males do so (with the female laying her eggs in the male’s lair or the male carrying the eggs to his lair).
Checking for eggs is evidence of a female lair, but may not always be the case.
1 I can speak to this with real world experience having worked in the poultry industry. It's not terribly difficult to sex chickens once you know what you're doing, but the experience required to be proficient at sexing dragons is notoriously hard to obtain. It takes a bit of practice and training, and while chickens are typically pretty permissive of anatomical inspection, the same cannot be said for dragons. Notably, chickens (Gallus gallus domesticus) do not engage in penetrative intercourse; sperm is transferred to the female reproductive tract through cloacal contact. In contrast, duck species reproduce through penetrative intercourse. Like I said, your mileage may vary. If your campaign comes down to exploring the details of draconic reproduction, it may be time to have an out of character meeting to make sure everyone is okay with the direction things are heading.