I live in Davis, and I ride bikes simply for commuting around the university and around town. My last bike is a hand-me-down from my sister's friend over 6 years ago; it's pretty much on it's last leg. So my friend has offered to give me his relatively new mountain (?) bike from Walmart (high quality for Walmart standards). I must admit, I know next to nothing about bikes, and I really don't want to spend the time or money getting a different (road) bike. I just know this one isn't a road bike. Will it be sufficient, or should I look into something else?
The question of big box bike quality to one side, the question should be not whether it's "appropriate" to ride this bike, but whether you like it.
Are you physically comfortable riding the bike? If so, great! If not, there are several questions here about bike fit that may help you get comfortable on the bike. A bike that doesn't fit you will never be a good bike for you.
Is the new bike reliable and in good shape? Things to check: Do the brakes work reliably? Does the bike shift well? If not, bring it to a bike shop and have a mechanic look at it.
Mountain bikes are great at navigating potholes and are good city bikes because they accelerate quickly. (That last is great for when the traffic light turns green - zoom!) They're also easy to outfit for snow and ice.
If you're concerned with other cyclists' thoughts on what's "appropriate"... well, that's their problem and not yours at all. If you like the bike, I suggest you ride it and enjoy it.
The most common use for "mountain" bikes is city riding. Usually the Walmart variety are a bit overdone with shocks and the like (what the kids like to see), but probably better suited for city riding than actual off-road riding.
As stated, if the tires are exceptionally "knobby" you may want to replace them with smoother ones (though not "slicks"). Tire pressure should be adjusted to suit road conditions -- higher for smoother roads, but never so low that the tires "bottom out" going over bumps. (And, if you replace the tires, you may want to get Kevlar belted ones, for puncture resistance.)
And, also as stated, it's very important that the bike "fit" -- that it's not too large or small for you, that the seat and handlebars can be adjusted to your comfort, etc.
Depends on your standards for 'never being passed by another cyclist under any circumstances whatsoever'. This metric only matters to the competitive part of your ego and if your ego insists on being larger than the whole universe and is not fed by success in other areas of life then it matters quite a bit.
If you are able to push your body ruthlessly hard and able to finesse traffic situations to always be ahead then there is kudos to doing so on a sub-optimal bike.
However, there will be that guy on a carbon fibre road bike that will move out to pass you without even bothering to draft you for what you are worth. He (or sometimes a she) will then vanish into the distance seemingly effortlessly whilst you fall apart with a stitch, torn muscles, sweaty cotton clothing and jumping gears, obviously to curse your heavy mountain bike with its stupid tyres, total lack of really big gears and the world's most unaerodynamic riding position. Naturally it will be the bike that is at fault during this moment, not your hedonistic lifestyle. You won't even think beyond envy about the guy that passed you. If you ever did find out what he thought of leaving you for dust then he would not let on to noticing you any more than any of the motorists did. That will be because he saw you ahead, did the necessary to pass you and then put a bit of a sprint on so you would not draft him.
In the pecking order of bikes, if you own a tricked out road bike then you have to pass everyone else that bothers to use the roads the pedal powered way. If you ride a heavy bike then you can let it go when someone that trains every day, carries not so much as a D-lock and rides a carbon bike passes you. And speed matters, that is why you ride instead of drive, right? So therefore, on balance, it is better to pass almost everything on a heavy MTB than to be on a posh road bike and not pass absolutely everything. So it sounds like you have the right bike.
As a few contributors have noted, it's all about the tyres, innit. Perhaps more important than tyre choice is tyre pressure. If you get a track pump and keep them rock hard, e.g. 10% above the pressure recommended on the sidewall, you will thunder along, floating on air so much faster than everyone else (except the guy on the carbon fibre road bike that also relies on high pressure tyres for his speed). You might as well wear out the tyres that are on there, but, when you do change them, get the legendary Schwalbe Marathon Plus tyres. With these you can participate in the stupid game of deliberately going over broken glass, to obviously not have to worry about a puncture any more than a tank driver has to worry about hitting a traffic cone.
Much like a tank, an MTB is a finely tuned, well oiled machine that can survive a lot of abuse. Take your friend's offer up on the bike, sort it out mechanically, get the fit 'n' comfort right for you and, as Neil says, enjoy it.
As for this 'I only ride to commute' attitude, that is far too sensible and in no way all of it. Your ride has got to be the highlight of your day, the endorphin rush that your body is physically addicted to. If you are not getting lost trying out new routes and learning the intricacies of your neighbourhood then you are not trying hard enough. Learn and master the streets and alleyways in a way that the guy on the posh road bike never would or could. Ideally you want to be always able to get from A to B quick 'n' fast on the roads or the more stimulating way on the car-free routes that exist everywhere. For this the bike you have coming your way sounds ideal.