Obama says if elected he will rebuild the middle class and create millions of new jobs by investing in the country 's infrastructure and in renewable energy .