We normally use the to refer to transportation methods that run on a fixed route, as in
I took the bus to school.
I took the subway to work.
I took the shuttle to the hotel.
We are not really talking about an individual bus but rather a means of getting from one place to another. The same can be said for I took the elevator to the fifth floor. When we want to refer to an individual bus, shuttle, or elevator, we can use either a/an or the depending on whether we think the listener knows which one we are talking about. If so, we would normally use the.
And we use a (an) to refer to transportation methods that do not run on a fixed route:
I took a taxi to John's house.
I took a limousine to the theater.
For school and home see
What's the difference between "go", "go to", and "go to the"?.
There is no easy way to determine when you use which article. Many uses are idiomatic and must be learned one at a time. Just expose yourself to more and more native English in natural contexts. Article usage and use of prepositions are two of the most difficult aspects of English for learners to master.
There are a number of ways to refer to a thing not as a particular instance but as the prototypical entity, as the class to which individual things of its type belong. Among them are the zero article and the definite article.
Did you look in the dictionary?
That idiomatic use is not referring to a particular dictionary (M-W, Cambridge, Longman's, Oxford, whatever) but to the resource in the abstract, the prototypical notion of it, the book that everyone knows.
There are sometimes dialect preferences for the one or the other:
They took him to hospital. BrE
They took him to the hospital. AmE
These are therefore equally viable expressions of the fact that you can play that kind of musical instrument:
I play the guitar.
I play guitar.
Another use of the prototypical meaning is when a musical group, a band, typically includes a guitar. In this meaning the sense borders on that of a role.
He played guitar for that band at Woodstock.
He plays washboard for the Slow Pokes.
And then we have the related phrases that ultimately derive from this idea of a typical role:
They sang backup.
He rode shotgun.
He flies copilot for Qantas.
Best Answer
Contrary to what is being said by other answerers, there is a real reason for this, and it's not just for musical instruments.
We use the phrasing "play the piano" because the piano isn't technically what is being played - it's the tool by which music is being played.
We see this type of phrase whenever someone uses the tool as a reference to the activity. You "wield the sword" as a swordfighter. You "wield the pen" as an author. You "use the keyboard", you "work the shovel". An alcoholic would "bury themselves in the bottle". An artist would "wield the brush" and a photographer would "wield the camera".
The construction also works with the tool replaced with the... well, the canvas, or whatever equivalent it might be. A farmer would "work the soil", the artist would "work the canvas", and the traveller would "ride the rail".