$|x-1| = |3x-1|+1$
Where $f(x)=|x−1|$ then $f(x)=x−1$ in a certain domain, $x≥1$. And $f(x)=−(x−1)$ in a certain domain, $x≤1$.
And $g(x)=|3x-1|+1$ then $g(x)=3x-1+1$ in a certain domain, $x≥1/3$ and $g(x)= -(3x-1)+1$ in a certain domain, $x≤1/3$.
I know this can be solved by squaring both sides and I'll get no solutions. And drawing them on a graph paper supports that.
$(x-1)^2 = (|3x-1|+1)^2$ →$8x^2-4x+2|3x-1|+1=0$ , $8x^2-4x+1$ can never be negative and so is $2|3x-1|$. So, there's no solution.
But doesn't we mean by squaring both sides that $x-1$ can be either negative or positive.
So it's like we are saying:
$-(x-1)$ can be equal to $-(3x-1)+1$, which has an answer $x = 0.5$.
However, this answer doesn't satisfy the domain of $g(x)$ when its equal to $-(3x-1)+1$, $x≤1/3$ so it's not correct.
Or
$-(x-1)$ can be equal to $3x-1+1$, which also has an answer $x=0.25$.
However this answer doesn't satisfy the domain of $g(x)$ when its equal to $(3x-1)+1$, $x≥1/3$ so isn't correct.
Etc.
But these answers since they are out of the domains of both functions aren't right but how can squaring guess that, why are the answers we get out of squaring always in the domain (if both functions are absolute value, I'm not talking about a case like this when only one function has an absolute value sign: $|x-1|=3x-1+1$) how can squaring know where the domain ends and starts, it seems like magic which surely can't be the case.
I tried to ask my teacher but he couldn't get my point, I hope someone will.
First of all, if you want to communicate your doubts to your teacher you need a common language: if you improperly use maths words, you cannot expect him to understand what your difficulties are.
By reading between the lines, I guess you do not understand why the equation $$|f(x)| = |g(x)| \tag{1}\label{1}$$ is equivalent to (has the same solutions as) $$f^2(x) = g^2(x).\tag2 \label{2}$$ Also you seem to assume that this has something to do with the values of $x$ for which the arguments of the absolute values are positive or negative (this is probably what you erroneously call domain). But, as a matter of fact, these are irrelevant, as far as the equivalence is concerned. Note in fact that the last equation is in turn equivalent to $$[f(x)-g(x)][f(x) + g(x)]=0.\tag3 \label{3}$$
To show equivalence between \eqref{1} and \eqref{2}, you can show that any solution to \eqref{1} is a solution to \eqref{2}, and viceversa.
Suppose $x_0$ is a solution to \eqref{1}. This means that $$|f(x_0)| = |g(x_0)|.\tag4 \label{4}$$ If $f(x_0)$ and $g(x_0)$ have the same sign, \eqref{4} implies $$f(x_0) = g(x_0).$$ If they have opposite sign, \eqref{4} implies $$f(x_0) = -g(x_0).$$ This shows that in any case $x_0$ is a solution to \eqref{3} and hence to \eqref{2}.
On the other way around, suppose $x_1$ solves \eqref{2}, and thus \eqref{3}. This means that either $$f(x_1) = g(x_1)$$ or $$f(x_1) = -g(x_1).$$ And this gives $$|f(x_1)| = |g(x_1)|,$$ that is $x_1$ solves also \eqref{1}.