How to deal with class partner who always wants to answer professor's question?
To answer your first question, there's nothing stopping you from answering or asking questions in class. If the other student answers questions by raising her hand, you could do so too; if she speaks out to answer questions, you could do so too. 

There is also no way you can ask someone else to change the way they behave in class as long as it is not disruptive to others. Just as you have your own reasons for wanting to answer questions, so may your classmate - maybe she wants a letter of recommendation too; maybe she just is the kind of student who naturally tends to voice out her thoughts while learning; maybe she just doesn't like keeping silent when she knows or thinks she knows the answers. Do you really expect to ask someone to not answer something so that you could get a letter of recommendation? 

To answer your broader question, trying to impress a professor by answering questions in class isn't probably the most efficient way to go about it. Make sure you get high scores in their homework/exams. If you get a good enough grade, you might even request doing a research project with them (if that's where you are interested in going). Professors understand that several bright students may stay silent in class for various reasons - maybe they are shy, maybe they aren't comfortable speaking publicly in English, or whatever other reason.