The limited coverage of terrestrial networks makes it difficult to provide low-latency and high-reliable computing services for users and Internet of Thing (IoT) devices in remote areas such as mountainous regions and oceans. Space-Air-Ground Integrated Network (SAGIN) combined with Mobile Edge Computing (MEC) can provide seamless three-dimensional services for users by deploying edge servers on satellites, Unmanned Aerial Vehicles (UAVs) and ground infrastructures. However, due to the limited heterogeneous computing resources in satellites-UAV clusters network and the energy resources of IoT devices, it brings a significant challenge in determining how to offload the computing tasks generated by ground user devices to satellite edge nodes, UAV edge nodes or locally for processing. In this paper, we first propose a satellites-UAV clusters-ground three-layer edge computing network architecture consisting of a global controller, inter-domain controllers and MEC servers. We then model the task offloading problem as a Binary Integer Linear Programming (BILP) aiming at minimizing the offloading cost composed of delay and energy consumption and prove it is NP-hard. Next, the original offloading problem is transformed to a noncooperative strategic game and the existence of Nash equilibrium is proven using potential games. Finally, we propose a Nash Equilibrium Iteration Offloading algorithm based on Game theory (NEIO-G) to find the optimal offloading strategy. Compared with other baseline algorithms, simulation results demonstrate that the NEIO-G can significantly reduce the system offloading overhead in terms of delay and energy consumption.