"I shot a sunset shot at like 135 to 150mm with F22 trying to get good dof and get everything sharp..but my photo came out blurred yet I shot it on the tripod. How is this possible with a high f-stop?"
As Bob said, the issue here could very well be diffraction, but as I know your still learning this stuff, I'd like to elaborate a little more on this issue for ya and I'll explore a few others for ya that could have contributed.
First, as was written in a recent article from a major publication (not OP), don't confuse "absolute sharpness with DOF". Remember that "sharpness" and "depth of field" are two very different things. While DOF is dependent on the aperture, it's also dependent on other things as well such as lens focal length and your subjects distance from the lens. Essentially when it comes to things like sunsets, we're talking about things that are, in most cases, far enough away from your camera that DOF pretty much becomes irrelevant regardless of what aperture you're shooting at. In other words, once your lens reaches "infinity" it's all cookies and milk when it comes to depth of field
It's also worth remembering that the reverse of this is true too...the closer your subject is to the camera at any given aperture, the less DOF you're going to have and using a larger aperture exaggerates that creating even less still (hence why macro photographers have such a really shallow DOF). There are exact and precise mathematical formulas that explain all of this in detail (as referenced in Bob's link) but the rough rule of thumb is simply; closer to the camera with a wide aperture, shallow depth of field...if your lens is at infinity and beyond, anything else is pretty much going to be wide open.
Fortunately, your question happens to coincide with my lens testing from the other day, so lemme give you a few examples. The following shots were taken with my Rebel XT and a Canon 50mm f1/8 "II" lens at f/2.8, f/4, f/8, f/11 and f/22 respectively. I shot these all in Aperture Priority mode so the shutter speed automatically changed with each change of the aperture setting. The camera was mounted on my tripod for these shots and I was a few hundred yards from the bridge. Except for opening up the shadows in Adobe RAW (sorry...had my EV comp set to -.3) and resizing for the internet, these shots are completely untouched...
As you can see, there's no difference here in the DOF between these images because the subject was far enough away from the camera for it to be irrelevant and the same applies to most landscape shots such as sunsets. At this size, there's not even much of a perceptible difference in sharpness between any of them, but if you were to blow them up, you would see that the f/4 and the f/8 are slightly sharper than the smaller apertures. It's interesting to note here that if you look closely at the seagulls that were flying around, at the wider apertures, the birds are more in focus because the camera selected a faster shutter speed where as with the smaller apertures, the gulls started to blur because of the slower shutter speeds.
When it comes to absolute sharpness, most things I've read seem to indicate that most lenses are sharpest 2 to 3 stops down from your widest aperture. You will also find that when it comes to a zoom lens...particularly if your budget minded like myself and can't afford Canon "L" lenses, that most of them have a "sweet spot" when it comes to sharpness regardless of aperture. For my Tamron 70-300mm, it seems to be right around 170(ish)mm. It's still pretty sharp at 300mm but it's noticeably less sharp at the wider settings (which is why I got a Sigma 17-50mm, the Canon 50mm and a Tamron 28-80mm).
Ok...I just edited this because I saw in the quote from you that you did in fact use a tripod. I had two paragraphs here blabbering on about that. There are other things though that can prevent your images from being sharp such dirty lenses and filters, moisture/condensation, etc.. If you're shooting into the sun (such as with a sunset) try to avoid using filters and especially polarizers as they can cause some real funky reflections if your not careful. If it's an older DSLR, it may be worth having a pro clean your sensor for you too. I tend to smoke cigarettes when I'm shooting and I've even had smoke from my smoke blow the shot! Basically there are all kinds of things that can prevent an image from being sharp...it's not just an aperture thing but hopefully you'll have a better understanding now of how that all works.
Alrighty, that's it for now. I hope some of this helps!