How to find possible values of x

You can use the triangle inequality, i.e. for three points $A,B$ and $C$ and the distances $AB, AC$ and $BC$ we have $AB + BC \geq AC$ thus here we can substitute in your values for the sides and get $5+7\geq x$ so $x\leq12$.

But the triangle inequality must hold for other arangements of sides as well, i.e. $AC + CB \geq AB$ so using the values above this gives $x + 7 \geq 5$ which implies $x>-2$ (now since $x>0$ this doesn't really help)

Consider the final arrangement $BA + AC \geq BC$, i.e. $5 + x \geq 7$ gives $x\geq2$ so combining all of these gives $$ 2 \leq x \leq 12$$