It's hard to say specificially, but it probably needs a wheel alignment.
First, find the camshaft sensor. It will be right in the front of the engine near the valve cover. Disconnect the plug and remove the bolt. Pull the camshaft sensor out. Insert the new camshaft sensor and reattach the plug.
The 2014 Mazda MAZDA6 has 16 valves.
The 2010 Mazda MAZDA6 has 16 valves.
The 2015 Mazda MAZDA6 has 16 valves.
The 2008 Mazda MAZDA6 has 16 valves.
The 2007 Mazda MAZDA6 has 16 valves.
The 2006 Mazda MAZDA6 has 16 valves.
The 2003 Mazda MAZDA6 has 16 valves.
The 2012 Mazda MAZDA6 has 16 valves.
The 2013 Mazda MAZDA6 has 16 valves.
The 2005 Mazda MAZDA6 has 16 valves.
The 2011 Mazda MAZDA6 has 16 valves.