I want to find the root of a function that has a piecewise part. This means that the value Mathematica will search will determine in which piece of the function we will be. I don't my example is the best, but this is the best example I could think of (and thank you @m_goldberg for helping be to Inactivate the function):
f[a_?NumericQ] := FindRoot[2 x^2 + Log[x] - a, {x, 0.01}][[1, 2]]
f[a_] := Inactivate[FindRoot[2*x^2 + Log[x] - a, {x, 0.01}][[1, 2]],
FindRoot | Part]
g[a_] := Piecewise[{{1 - f[a] + Log[f[a]],
a <= 1}, {Log[2*f[a]] + f[a], a > 1}}]
Findroot[g[a] + Log[a], {a, 0.1, 0.01, 10}]
Any ideas?