Don’t understand how nonlinear resistors violate Ohm’s law Ohm’s law states that the voltage across a resistor is directly proportional to the current through. This is given by the formula v=iR. But most textbooks say that this law is violated when the v vs i graph is nonlinear. However, at each point along the graph of a non linear resistor, v=iR holds, only now R is changing. So, is my understanding of the above definition of Ohm’s law wrong? Is Ohm’s law exclusively defined for linear resistors?
 A: In the words of Captain Barbossa, "they're more like guidelines."
Ohm observed that for many elements (things we call "resistive"), there was a linear relationship between voltage across the element and current through it.  Given there is a linear relationship, one can compute a constant describing that relationship: R.
Ohm's law is a linear relationship.  Thus, by definition, it is violated by anything which is non-linear.  Simple as that.  You don't even need to think about it!  In fact, it's really more of an observation, than a law.
Okay, so I lied there.  There's still plenty to think about.  You mention a non-linear curve where "R" varies with respect to voltage (and/or current). And yes, you can build such curves.  One would not call them "obeying" Ohm's law, because R is now a dependent variable.  Indeed, one can provably build such a curve for any "two port" device which does not store energy.  It just isn't called "obeying Ohm's law" because it isn't linear.
The most common place where we would build such a mathematical construct is in almost linear systems.  Many systems are nearly linear in what we call a "small signal" model.  In these systems, we assume that there is some large current going through the system which we use to define a R at that point, and then perturb it by some small signal which is too small to meaningfully change the resistance.  Sure it changes, but in many situations we can safely ignore that change when quantifying how a system behaves.  If you have some calculus under your belt, you may recognize the extreme limit of this approach is exactly the same thing as what we do when we say the derivative $\frac{dy}{dx}$ defines a line that is tangent to the curve $y(x)$ at some point.  The only difference is that, as physicists and engineers rather than mathematicians, we have a lot more room to talk about rounding and equations that are close to being correct.
When you get into studying amplifiers, this is exactly where you will go.  Amplifiers are notoriously non-linear devices, but we typically want them to amplify something in a linear way.  We do this by constructing circuits where we can "set" their behavior with some large bias current or voltage, and then observing this "small signal" behavior as-if the amplifier were a linear device that doesn't store energy, like a resistor.
In fact, when you get into situations like this, you'll come across concepts like "negative resistance."  At first it sounds absurd, because no resistor can have a negative resistance -- their resistance is always positive.  But in a non-linear circuit, you often bias the non-linear circuit into a regime where, if you choose to look at it as-if it were a small-signal linear circuit, the resistance will be negative.
I mentioned earlier that we physicists and engineers can afford to be just "close" to correct with our models?  Amplifiers are a great example of the corner where such thinking gets interesting.  You can easily prove that your small-signal model gets you the right answer within, say, 3% of the right answer.  Is that close enough?  The human ear can often hear that kind of distortion, so if you are making an amplifier for a stereo, you may have to use better modeling.  If you're making scientific equipment, even smaller errors may be required!
A: Much has been written about Ohm's law and I would suggest you first forget about it and look at the definition of $\text {resistance},\,\Omega= \dfrac{\text{potential difference},\, V}{\rm current,\,A}$.
There are conductors which have a constant resistance independent of current/voltage and conductors whose resistance varies with current/voltage.
A graph of potential difference against current is a straight line through the origin if the resistance is constant and not so otherwise.
For conductors whose resistance is not constant an incremental / small signal /dynamic / differential resistance can be define at a chosen current / voltage as $R_{\rm incremental} = \dfrac{dV}{dI}$, ie the gradient of the voltage against current graph at the chosen current / voltage.
The reason for doing this is that one can, to the first approximation, use the incremental resistance to relate a small change in voltage $\Delta V$ to the small change in current $\Delta I$, $\Delta V = R_{\rm incremental}\,\Delta I$.
Ohm's law, $V\propto I$ , which I have not used so far, is a law based on experimental observation and is obeyed to a good approximation by many conductors.
The constant of proportionality can be used as the definition of resistance but please note this can cause confusion, as it did for you.
So better use the potential difference divided by current definition of resistance applicable to all conductors and then if Ohm's law is obeyed the resistance is constant.
A: What one refers to as "Ohm's law" is a linear relationship between the current and the potential difference, i.e., (see also this answer)
$$
V = IR\text{ where } R=const
$$
If $R$ is not a constant, the relationship is non-linear which is equivalent to saying that the Ohm's law does not hold.
One can (and does) introduce effective resistance/conductance that is dependent on the potential difference or current either as their ratio
$$
R(V)=\frac{V}{I(V)}
$$
or as a slope of the I-V characteristics
$$
\frac{1}{R(V)}=\frac{dI(V)}{dV}.
$$
A: It seems like this is more of a lack of understanding of the mathematical term "directly proportional", rather than a physics question. Two variables are directly proportional if there is some constant such that one variable is equal to the other variable times that constant (generally this constant is required to be non-zero, but this isn't always given in the definition). Emphasis on the word "constant". The constant has to have the same value regardless of what the variables are equal to. If we didn't have that constraint, then "directly proportional" would be a vacuous term, as for any particular two values, we can always find some third value such that one of the original values is equal to the other original value times the third value.
