Isn't the line $y = 0$ a tangent line to $y = |x|$? It's well known that the derivative of the function $|x|$ is not defined at $x = 0$ because the left and right limits are different. But consider that the tangent line is a line that touches a curve in only one point. Even though the derivative doesn't exist, $y = 0$ meets the requirements of being a tangent line of $|x|$ at $x = 0$, doesn't it? What am i missing on the definition of a derivative as the slope of the tangent line? Is there an extra condition not being considered? 
What is the exact definition of the tangent line of a curve in the derivative context?
 A: Defining the tangent as the line which touches the graph of the function at only one point is insufficient, because, for any given $x_0$, there could be many such lines. For example, if we have $f(x) = x$, the line $y=\frac{1}{2}x$ would be a "tangent" to the graph at $x=0$ under this definition, which is of course absurd. 
Furthermore, somewhat counterintuitively, it's not even always true that a tangent line intersects the graph of a function at only one point. For example, if you consider $f(x) = x^2\sin \frac{1}{x}$ with $f(0) = 0$ defined on $\mathbb{R}$, the line $y=0$ is a tangent to the graph of $f$ at $x=0$, but in every neighbourhood of $0$, the line intersects with $f$ countably infinite many times. 
The tangent line of $f$ at $x_0$ is better thought of as being the unique line $l(x)$ which intersects the graph of $f$ at the point $(x_0, f(x_0))$ and is locally the best linear approximation to $f$ in the sense that $f(x) - l(x) = o(x-x_0)$. If such a line exists, $f$ is said to be differentiable at $x_0$. 
A: For the functions, whose derivative do not exist at some particular points, we usually use subderivative or subgradient. Their values match the value of the actual derivative of the function wherever they exist. 
For $f(x)=|x|$, the subgradient is $1$ when $x>0$, $-1$ when $x<0$, and $[-1,1]$ at $x=0$.
