Let $0 \leq a \leq x \leq 100$ and $f(x) = |x-a|+|x-100|+|x-a-50|$, then the maximum value of $f(x)$ becomes $100$ when $a$ is equal to what?
As $a \leq x$, so $|x-a| = x-a$ and as $x \leq 100$, so $|x-100| = 100 -x$.
Now $f(x) = 100-a + |x-a-50|$
As per the question;
$f(x) = 100-a + |x-a-50| = 100$
$\Rightarrow |x-a-50| = a $
How can we proceed from here to find the value of $a$ when $f(x)$ will be maximum i.e. $100$ ? Please help !!!!
Let $I=[a,100]$.
Let us start from your expression :
$$f(x) = 100-a + |x-a-50| $$
$f$ takes its maximum $f(x_{max})=100$ if and only if $$g(x) := |x-(a+50)| - a $$
takes its maximum $g(x_{max})=0$.
The important point is that there are two "ways" a function can take its maximum :
(1) on an interior point of $I=[a,100]$ (the domain of definition of $g$).
(2) or on a border point, i.e., at one of the bounds $a$ or $100$ of $I$.
As function $g$ cannot have a maximum in the interior of $I=[a,100]$ (see explanation $\star$ below), we are in the case (2).
The issue becomes then :
$$\max(g(a),g(100))=0$$
Otherwise said, $a$ must be such that :
$$\max(50-a,|50-a|-a)=0\tag{1}$$
In fact, (1) can be reduced to :
$$50-a=0 \tag{2}$$
as proved by the following graphics where (red) curve $y=50-a$ is always above (blue) curve $y=|50-a|-a$
As a consequence, the only possible value : $a=50$.
Explanation of $\star$:
if $a+50 \le 100 \iff a \le 50$, function $g$ is decreasing, then increasing (a "V" shape) : it has a minimum in $x=a+50$ but no maximum.
otherwise, if $a > 50$, function $g$ is always decreasing on interval $I=[a,100]$.
Edit : In fact, there is a slightly more sophisticated version for the latter explanation using "maximum modulus property" : $g$ being a convex function, whatever the compact domain of definition $[a,b]$ to which $g$ is restricted, its maximum is attained in one of the bounds $a$ or $b$ (see for example here).