  We study the properties of spin-less non-interacting fermions trapped in a
confining potential in one dimension but in the presence of one or more
impurities which are modelled by delta function potentials. We use a method
based on the single particle Green's function. For a single impurity placed in
the bulk, we compute the density of the Fermi gas near the impurity. Our
results, in addition to recovering the Friedel oscillations at large distance
from the impurity, allow the exact computation of the density at short
distances. We also show how the density of the Fermi gas is modified when the
impurity is placed near the edge of the trap in the region where the
unperturbed system is described by the Airy gas. Our method also allows us to
compute the effective potential felt by the impurity both in the bulk and at
the edge. In the bulk this effective potential is shown to be a universal
function only of the local Fermi wave vector, or equivalently of the local
fermion density. When the impurity is placed near the edge of the Fermi gas,
the effective potential can be expressed in terms of Airy functions. For an
attractive impurity placed far outside the support of the fermion density, we
show that an interesting transition occurs where a single fermion is pulled out
of the Fermi sea and forms a bound state with the impurity. This is a quantum
analogue of the well-known Baik-Ben Arous-P\'ech\'e (BBP) transition, known in
the theory of spiked random matrices. The density at the location of the
impurity plays the role of an order parameter. We also consider the case of two
impurities in the bulk and compute exactly the effective force between them
mediated by the background Fermi gas.
