Q:

Find number of zeros $ x = \ln |x-a| $

Find number of zeros $$ x = \ln |x-a| $$
depending on the value of $a$.
My try
Usually I solve task like that in use of derivatives: 
Let $$f(x) = x - \ln |x-a| $$
Ok now it is time for derivatives and check what is happening
Assume that $f'(x)$ exists... 
$$f'(x) = 1 - \frac{(|x-a|)'}{|x-a|} $$
Okay, I see that for $$|x-a| = 0 \rightarrow x=a$$
$f'(x)$ doesn't exists but it is not weird because $f(x)$ doesn't exists too. 
Now I can check different cases for $x<a$, $x>a+1$ and $x \le a+1$ - then I can see behavior of $f$ depending on the value of $a$. But there is some cases to check. I wonder if there is a simpler solution, maybe "tricky" one?

A:

The function $\ln|x-a|$ has two branches (the left branch which is strictly decreasing and the right branch which is strictly increasing). Since these branches are disjoint at $x=a$, we obtain$$\text{number of roots of }(x=\ln|x-a|){=\text{number of intersections of }y=x \text{ with the left branch} \\+\text{number of intersections of }y=x \text{ with the right branch}}$$but from the other side$$\text{number of intersections of }y=x \text{ with the left branch}=1$$which is quite obvious. Now define $$r(a)=\text{number of intersections of }y=x \text{ with the right branch}$$Different scenarios are considerable.
Case 1 : $a>-1$
In this case according to the famous inequality $u\ge\ln1+u$ we can write$$x{> x-a-1\\\ge \ln 1+(x-a-1)\\=\ln x-a\\=\ln|x-a|}$$therefore the right branch has no intersection with $y=x$ and $r(a)=0$.
Case 2 : $a=-1$
Once more, according to the inequality $u\ge \ln1+u$, the only intersection happens at $x=0$ therefore $r(a)=1$.
Case 3 : $a<-1$
In this scenario, since $\ln x-a$ is concave and $\ln (x-a)\Big |_{x=0}=\ln (-a)>1=\ln 0=x\Big|_{x=0}$ the there are exactly two intersections with $y=x$ hence $r(a)=2$.

Conclusion
The final formula for number of roots of $x-\ln|x-a|$
  is:$$r(a)=\begin{cases}1&,\quad a>-1\\2&,\quad a=-1\\3&,\quad
 a<-1\end{cases}$$

