Nowadays, the Internet of Things (IoT) is one of the most important fields in computer science. In IoT everything is connected and can be controlled via the internet, this phenomenon has brought many challenges such as tremendous processing load which causes low resourced devices to get overloaded. In other words, the challenges and disadvantages of intelligent things are the weakness of hardware and limited energy for handling traffic loads. This is why the issue of processing offloading is raised. Processing offloading is moving the processing load out of the IoT devices to cloud/fog. Remote service cloud computing is one of the important options in processing offloading. However, cloud computing has some disadvantages, such as increasing delays and costs, due to being away from users' devices. On the other hand, the large volume of cloud information has led to network saturation. Therefore, to address this problem in recent years, fog computing has been suggested as one of the suitable options for offloading. Fog computing can be considered as a complement to cloud computing. In fog computing, processing resources that are close to the things are selected to offload in order to eliminate the distance problem as much as possible. Although the distance problem can be solved by offloading to close fog nodes, other challenges have been raised, such as lower energy and limited resource in comparison to the cloud. Therefore, when submitting a request to fog there will be a major challenge of whether the fog is able to provide the service or not? To answer this question, the cloud can be considered as a complement to fog computing. The main issue of this thesis is the offloading and selecting an appropriate location between cloud and fog. In this thesis, deep reinforcement learning is used to determine the offloading strategy. Deep reinforcement learning is a combination of deep learning and reinforcement learning that removes known problems of reinforcement learning. In this work we utilize an improved version of the deep reinforcement learning algorithm, called Double_DDQN , which attempts to design a strategy for the offloading problem. The evaluation results indicate that using fog computing by the Double_DDQN method is better than not using fog. In addition, to compare with benchmarks, which use fog in a simple way, the proposed method has illustrated better performance.