  We prove that many spaces of positive scalar curvature metrics have the
homotopy type of infinite loop spaces. Our result in particular applies to the
path component of the round metric inside $\mathcal{R}^+ (S^d)$ if $d \geq 6$.
  To achieve that goal, we study the cobordism category of manifolds with
positive scalar curvature. Under suitable connectivity conditions, we can
identify the homotopy fibre of the forgetful map from the psc cobordism
category to the ordinary cobordism category with a delooping of spaces of psc
metrics. This uses a version of Quillen's Theorem B and instances of the
Gromov--Lawson surgery theorem.
  We extend some of the surgery arguments by Galatius and the second named
author to the psc setting to pass between different connectivity conditions.
Segal's theory of $\Gamma$-spaces is then used to construct the claimed
infinite loop space structures.
  The cobordism category viewpoint also illuminates the action of
diffeomorphism groups on spaces of psc metrics. We show that under mild
hypotheses on the manifold, the action map from the diffeomorphism group to the
homotopy automorphisms of the spaces of psc metrics factors through the
Madsen--Tillmann spectrum. This implies a strong rigidity theorem for the
action map when the manifold has trivial rational Pontrjagin classes.
  A delooped version of the Atiyah--Singer index theorem proved by the first
named author is used to moreover show that the secondary index invariant to
real $K$-theory is an infinite loop map. These ideas also give a new proof of
the main result of our previous work with Botvinnik.
