1. It is 3 dollars to take the subway.

==============
Is this sentence grammatical? What does 'It' refer to in the sentence? Does 'It' refer to 'the subway' or ' to take the subway'?

The sentence is grammatical. It might be clearer to say, "It costs three dollars to take the subway." "It" refers to the phrase "to take the subway."