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.
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.
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.
There are a few pro's and con's to mountain bikes in the city.
You don't really care about potholes, uneven pavements, bad cycle lanes, tree roots etc. so much. The wide tires & suspension take care of those.
You don't loose as much speed due to bad road conditions. Since your average tree root does not accelerate the entire bike including rider upwards, it costs you much less energy to roll over it. Mountain bikes are built to be fast on really bad roads.
You loose speed on smooth roads. The wide tires, especially when they are knobby, eat some energy, and the suspension does the same.
With a full-suspension mountain bike, it may be hard/impossible to fit a rack on it. I find it quite important not to have to wear a backpack on my back, but your preferences may be different in this.
Mountain bikes are typically heavier than road bikes. This is a non-issue on a flat road and only slightly relevant when going up hills, but it can be very relevant if you regularly need to carry your bike up/down stairs.
Whether you deem the pro's or the con's more relevant is up to you. Consider both, and make your choice. There's a good number of cities where a mountain bike is the only sane choice for the bad quality of their bike lanes.
The energy loss issue on smooth roads can be mitigated to quite some extend, though:
I'd check if I could fit touring tires on the bike. Should be possible, even though it's likely to look a bit weird. This will allow you to put much more pressure into your tires and removes the energy drain from the knobby profile of many mountain bike tires.
Some suspensions can be deactivated, precisely to avoid the energy loss on smooth roads. Check if the bike has such a lock-out and try it both with and without the lock-out.