I'm reading in I Samuel 16:21. It says that David came into Saul's service to play harp for Saul then became one of Saul's armor-bearers. Saul even sent word to Jesse saying to 'allow David to remain in my service,' so I would assume that Saul knew who David was. However, in I Samuel 17:58, when David came back from slaying Goliath, Saul asked him "whose son are you, young man?" How can Saul not know who David was after he played harp and bore his armor all this time already?
It is a good question that tells us more about Saul's character. Here is a man who had people working for him, yet he did not really know them well.
But do notice that Saul did not ask for David's name, he asked who David's father was. We sometimes forget that time can pass between recorded events. We read them one after another, but it doesn't mean they happened one immediately after another. David did spend time playing for Saul and became Saul's armor-bearer (I Samuel 16:14-23). Even in asking Jesse for permission to have David stay with him doesn't mean that Saul would necessarily remember who he sent a message to if it was years later. Time apparently did pass because in I Samuel 17:15 we find that "David occasionally went and returned from Saul to feed his father's sheep at Bethlehem." In fact, during the time of the Philistine war, David was at home (I Samuel 17:17). We are not told how long David had been gone this last trip. Yet, Saul does appear to be familiar with David when he had David appear before him (I Samuel 17:31-39); after all, he was willing to loan David his own armor.
He asked his captain to remind him who David's father was, but Abner did not know (I Samuel 17:55). At the time, David was just going on the field and perhaps Saul was thinking he would need to send condolences to his family. After David, a mere youth, so soundly defeated Goliath, I can see Saul's mind working: If a young man can do so much, what might his older brothers, if he had any, be able to do? He didn't get an answer from his staff, so he naturally ask David directly when he returned.