Global behavior of a third-order rational difference equation