Fog computing is a promising and challenging paradigm that enhances cloud computing by enabling efficient data processing and storage closer to data sources and users. This paper introduces a game-theoretic approach called GTRADPMFC (Game-Theoretic Resource Allocation and Dynamic Pricing Mechanism in Fog Computing) to address resource allocation and dynamic pricing challenges in fog computing environments with limited resources. The proposed model features non-cooperative competition among fog nodes for resources and dynamic pricing mechanisms to encourage efficient resource utilization. Theoretical analysis and simulations demonstrate that GTRADPMFC improves resource efficiency and overall fog computing system performance. Additionally, the paper discusses how to handle situations with insufficient samples and provide flexibility for users unable to meet completion time requirements. GTRADPMFC effectively manages resource allocation by establishing pricing in fog computing, considering potential delays in completion time. This is achieved through research, simulations, convergence analysis, complexity evaluation, and optimization guarantees.