The absolute value $|x|$ can be represented as $\sqrt{x^{2}}$, as per this question.
Let $f(x) = |x| = \sqrt{x^{2}}$. Solving for $f'(x)$, let $u = x^{2}$. Then, \begin{align*}\frac{df}{dx} &= \frac{df}{du}\cdot\frac{du}{dx} \\ &= \frac{d}{du}(\sqrt{u})\cdot\frac{d}{dx}(x^{2}) \\ &=\frac{1}{2\sqrt{u}}\cdot2x \\ &= \frac{x}{\sqrt{x^{2}}} \\ &= \frac{x}{|x|}\end{align*}
We can also see that $\sqrt{x^{2}} = \left(\sqrt{x}\right)^{2}$. Then, let $u = \sqrt{x}$. Solving for $f'(x)$, \begin{align*}\frac{df}{dx} &= \frac{df}{du}\cdot\frac{du}{dx} \\ &= \frac{d}{du}(u^{2})\cdot\frac{d}{dx}(\sqrt{x}) \\ &= 2u\cdot \frac{1}{2\sqrt{x}} \\ &= \frac{\sqrt{x}}{\sqrt{x}} \\ &= 1\end{align*}
I think the problem here is by letting $u = \sqrt{x}$. What seems to be the problem?