Confusion about independent and identically distributed? Say that I wish to measure the height of male within the population (so gender=Male is the only factor I am accounting for). Say I collect 100 observations of male height from an elderly population. This is not representative of male heights because it is heights of males of a particular age range. Since my sample age may differ from the population average, if i derive a MLE, then it will be completely different to the population parameter.
Am I violating the assumption that my random variables are iid?

It seems like you have two questions in one.
First, you're asking whether sampling heights from a population of older males is IID. I believe that it is, because the samples are in no way dependent on each other. If you randomly sample older males to measure their heights, each sample is independent (since it's totally random) and they will be identically distributed because the samples are coming from the same population/distribution. You can think of this as: if I collect 1,000 of these samples and then another 1,000 , these two big sample groups should have the same distribution (as each sample within each group was taken from the same "parent" distribution).
You bring up a second question though, about your sampling being from older males, so your average height would be being totally different from the total population of people of any age/gender. This is certainly correct. However, I'm not sure this point has any connection with your question about being IID.
Scenario A - If you randomly sample heights from older male population: your samples will be independent and all coming from same distribution (identically distributed).
Scenario B - If you randomly sample heights from ALL people: your samples will still be independent, and all samples will still come from the same "parent" distribution (identically distributed). The "parent" distribution is different than in Scenario A, but all your samples are coming from the same one.
In both cases, your samples are IID. You're just sampling from different populations (statistically and demographically speaking), so you're estimating different parameters (since the true mean height is different for these two populations).
Hope that helps!
Anyone please correct me if my basic stats are rusty!
