1. An air-fuel ratio control apparatus for an internal combustion engine including a variable lift mechanism that changes a lift amount of an intake valve, the air-fuel ratio control apparatus comprising: a first control unit that performs an air-fuel ratio control to correct a fuel injection amount command value using a correction amount that is set based on a value output from a sensor provided downstream of an exhaust gas purification catalyst in an exhaust passage of the internal combustion engine, which outputs a signal indicating an oxygen concentration in exhaust gas downstream of the exhaust gas purification catalyst; and a second control unit that learns a relationship between a deviation of the correction amount from a reference value and the lift amount, that calculates a learned deviation value based on the lift amount, using the learned relationship, and that corrects the fuel injection amount command value using the correction amount including the calculated learned deviation value, the second control unit learns the relationship, calculates the learned deviation value, and corrects the fuel injection amount command value using the learned deviation value, on the condition that the lift amount is smaller than a predetermined lift amount, and the second control unit sets, in advance, a linear function as the relationship; calculates the deviation, wherein the deviation is a first deviation which corresponds to a specific lift amount that is smaller than the predetermined lift amount; changes a slope of the function based on the calculated deviation; and learns the relationship indicated by the function having the changed slope.