Mobile edge computing (MEC) is seen as a promising method of computation offloading. Moving services from cloud servers to mobile edge nodes (MENs) can decrease service response time. Due to the restricted processing and bandwidth capabilities of MEC networks, service caching and replacement incurs inescapable latency and energy costs. Thus motivated, we propose the joint service caching and task offloading problem in edge networks (SCTOE) to minimize the cost of edge services. We present a collaborative service caching mechanism (CSCM) that strengthens service sharing between MENs by forming caching coalitions. We prove that SCTOE is NP-hard and that CSCM can enhance the service efficiency of the edge network by theoretical analyses. Then we utilize a random rounding algorithm (RR) to figure out the feasible solution to the SCTOE problem. Finally, we test the performance of the CSCM+RR algorithm by simulating experiments using a real dataset. Simulation results demonstrate that our approach can effectively utilize the available caching resources to maximize the performance of the algorithm in the average response delay and the profit of edge networks.