We use the terms ∞-categories and ∞-functors to mean the objects and morphisms in an ∞-cosmos: a simplicially enriched category satisfying a few axioms, reminiscent of an enriched category of fibrant objects. Quasi-categories, Segal categories, complete Segal spaces, marked simplicial sets, iterated complete Segal spaces, θn-spaces, and fibered versions of each of these are all ∞-categories in this sense. Previous work in this series shows that the basic category theory of ∞-categories and ∞-functors can be developed only in reference to the axioms of an ∞-cosmos; indeed, most of the work is internal to the homotopy 2-category, a strict 2-category of ∞-categories, ∞-functors, and natural transformations. In the ∞-cosmos of quasi-categories, we recapture precisely the same category theory developed by Joyal and Lurie, although our definitions are 2-categorical in natural, making no use of the combinatorial details that differentiate each model. In this paper, we introduce cartesian fibrations, a certain class of ∞-functors, and their groupoidal variants. Cartesian fibrations form a cornerstone in the abstract treatment of “category-like” structures a la Street and play an important role in Lurie's work on quasi-categories. After setting up their basic theory, we state and prove the Yoneda lemma, which has the form of an equivalence between the quasi-category of maps out of a representable fibration and the quasi-category underlying the fiber over its representing element. A companion paper will apply these results to establish a calculus of modules between ∞-categories, which will be used to define and study pointwise Kan extensions along ∞-functors.