Germany, the largest economy in Europe, is on a precarious economic path, facing potential stagnation due to its ageing population, warns the International Monetary Fund (IMF).