"I have not shown my apartment to anyone."
Translation:Я никому не показывал свою квартиру.
In Russian you tend to use "свой" as often as you can, especially in spoken language. In Swedish, for instance, sin/sitt (свой) works only for the third person, when something belongs to the person spoken about. In Russian, on the other part, it works for all persons and numbers: мы не показывали свою квартиру, они не показывали свою квартиру (we/they dind't show our/their appartment).
Кто-нибудь means someone or anyone in phrases like: is there anyone here? (Есть здесь/тут кто-нибудь?) or: Leave the book here, and someone will take it afterwards (оставьте книгу здесь, кто-нибудь её возьмёт/заберёт потом). In this case however you have никто meaning basically No one, since you can rebuild the phrase: I have shown my appartment to no one/nobody. It would be probably more unnatural in English with "no one", but thus you get the idea. If you can replace someone/anyone by no one or nobody, then it is никто. So: Show your appartment to someone (покажи кому-нибудь свою квартиру) - no opportunity to replace with nobody. And, of course, pay attention to the declension, here it is the dative case.
Ahhh, thank you for the explanation. I understand now: both why it can't be кто-нибудь and why Duolingo suggested it.
The more literal English translation would be "I have shown no one my apartment" — the "not anyone" is just an English quirk used as a synonym for "no one".
I don't think the second part of your comment is correct (you CAN replace someone with no one there), but not to worry, because I already understood the situation by that point :)
it may be accepted but it sounds really unnatural, and people don't usually call their flats апартаменты, unless it's some kind of fashionable ridiculously expensive kind of apartment, or a hotel apartment, or they are just being arrogant and believe that they make their speech more interesting and colourful by adding more words like that. Which is, by the way, totally not true.