I'm going to use the word "I" in this answer since there is no universally agreed-upon standard for what a referee should do.
I feel that the referee's only job is to make an informed recommendation to an editor as to whether or not a paper should be accepted. The extent to which that includes verifying that a paper is correct is a bit subtle -- you want to be able to vouch for the paper's correctness, but ultimately the correctness of the paper is the author's responsibility. My personal interpretation of that mandate is that I should understand and believe all the arguments of the paper, though there have been times when I have not verified things like enormous calculations, in which case I make that caveat in my report. I should also have no good reason to doubt the results of anything that is cited. If I have such a doubt (and I frequently have doubts about the correctness of both the published and the unpublished literature!), then my job is not to go and referee those papers as well. Instead, in my report I give an honest account to the editor of my concerns, and let them decide how they want to handle them.