  We study a portfolio optimization problem for competitive agents with CRRA
utilities and a common finite time horizon. The utility of an agent depends not
only on her absolute wealth and consumption but also on her relative wealth and
consumption when compared to the averages among the other agents. We derive a
closed form solution for the $n$-player game and the corresponding mean field
game. This solution is unique in the class of equilibria with constant
investment and continuous time-dependent consumption, both independent of the
wealth of the agent. Compared to the classical Merton problem with one agent,
the competitive model exhibits a wide range of highly nonlinear and
non-monotone dependence on the agents' risk tolerance and competitiveness
parameters. Counter-intuitively, competitive agents with high risk tolerance
may behave like non-competitive agents with low risk tolerance.
