Intelligent Transport Systems (ITS) provide a promising technology to enhance road safety. The vehicular standard wireless access in vehicular environment (WAVE), also known as dedicated short-range communication (DSRC), can assist in reducing the number of deadly crashes. However, DSRC has a limited range. To enhance the network coverage, roadside units (RSUs) are placed along the road. However, the placement of RSUs at every instant increases the infrastructure cost. In this paper, we proposed the cooperative vehicular architecture, with network function virtualization (NFV) enabled RSU inside the mobile edge computing (MEC) unit. RSUs are only placed in the dense traffic region. We applied the Long short-term memory (LSTM) based machine-learning algorithm to predict the traffic flow based on the vehicle information table (VIT) maintained at the MEC unit. NFV is implemented at the top of RSU. Based on predicted traffic density it assists RSU to enhance its coverage range by exploiting the transmit power. Furthermore, MEC is also responsible for cooperative relay-based communication. Optimal stopping theory is modeled to select the best candidate relay node immediately. In this paper, we tested the proposed scheme in actual on-road vehicles and through simulations performed in network simulator NS-3.