  We develop a general framework for the description of anomalies using
extended functorial field theories extending previous work by Freed and
Monnier. In this framework, anomalies are described by invertible field
theories in one dimension higher and anomalous field theories live on their
boundaries. We provide precise mathematical definitions for all concepts
involved using the language of symmetric monoidal bicategories. In particular,
field theories with anomalies will be described by symmetric monoidal
transformations. The use of higher categorical concepts is necessary to capture
the Hamiltonian picture of anomalies. The relation to the path integral and the
Hamiltonian description of anomalies will be explained in detail. Furthermore,
we discuss anomaly inflow in detail. We apply the general framework to the
parity anomaly in fermionic systems coupled to background gauge and
gravitational fields on odd-dimensional spacetimes. We use the extension of the
Atiyah-Patodi-Singer index theorem to manifolds with corners due to Loya and
Melrose to explicitly construct an extended invertible field theory encoding
the anomaly. This allows us to compute explicitly the 2-cocycle of the
projective representation of the gauge symmetry on the quantum state space. As
a second application, we study discrete symmetries of Dijkgraaf-Witten theories
and their gauging. Non-abelian group cohomology is used to describe discrete
symmetries and we derive concrete conditions for such a symmetry to admit 't
Hooft anomalies in terms of the Lyndon-Hochschild-Serre spectral sequence. We
give an explicit realization of a discrete gauge theory with 't Hooft anomaly
as a state on the boundary of a higher-dimensional Dijkgraaf-Witten theory.
