The first and last names are given in the last two lines of the poem.
Jane was her first name,
What was her last name.
The two lines make one complete sentence, and there is a period at the end of the sentence, not a question mark.
So the sentence doesn't ask a question. It tells you that Jane was the first name and that What was her last name.
Her name was Jane What.