Keep in mind that fifth-grade friendships are difficult for all girls. As they become more independent and begin to experience the hormonal changes that come with puberty, their friendships can change from day to day.
Try to find assistance for your daughter with her writing skills and her studying. Check into tutors in your area or ask around your neighborhood to see if there might be a high-school student who could work with her. The extra boost of confidence that can come from feeling good about her school work can carry over to other parts of your daughter's life as well.
Talk also with the school counselor. He or she may be able to give your daughter some individual time or include her in a small group on friendship, social skills, or study skills.