"My last name is Li, and yours?"
I had the same problem. The solution ended up being punctuation - I was typing "我姓李, 你呢?" instead of "我姓李，你呢？"
Note the "," / "，" and "?" / "？" differences. The longer version of punctuation is the correct one for Duolingo. This will vary based on your computer, but for Windows 10 the default for me is to hit CTRL+punctuation to produce the fixed width versions and get this answer correct.
Because 姓 is a verb.
The verb 姓 (xing) means "to be called, to be designated, to be named", referring to the last name or surname. For example my name is "John Williams", so in Chinese, someone ask for me what's my surname:
你 姓 什么？
Ni shing shima? You surname how? (How you are surnamed?)
So I answer:
我 姓 Williams, 你呢？ Wo shing Williams, you what? I surname Williams, you what?
For to refer about the first name, we use the verb Jiao 叫 ”to be called"
Wo jiao John. 我 叫 John.
The word 的 (de) means possession, or "of", and is used with noums.
我的 (wode): "my" 你的 (nide): "yours" 他的 (tade): "his" 她的 (tade): "her"