The geometry of chaos: Dynamics of a nonlinear second-order difference equation