There is no finite solution for the given IC. To see this more clearly, will use Michael E2 code from
simplifying-dsolve-output-exponentials-raised-to-constant
ClearAll[f, y, x];
constSimplify2 // ClearAll;
constSimplify2[dsol_, rest___] :=
Activate[
FixedPoint[#[[First@OrderingBy[#, LeafCount, 1]]] &[{#,
Replace[#,
s_ /; ! FreeQ[s, Power[_, p_ /; ! FreeQ[p, _C]]] :>
Simplify[# /.
Cases[#,
Power[_,
p_ /; ! FreeQ[p, _C]] :> (c :
Alternatives @@ Cases[p, _C, {0, Infinity}] :>
Log[c]), Infinity], rest]],
Replace[#,
s_ /; ! FreeQ[s, a_?NumericQ c_C] :>
Simplify[# /.
Cases[#, a_?NumericQ c_C /; a != 0 :> (c :> c/a),
Infinity], rest]],
Replace[#,
s_ /; ! FreeQ[s, a_?NumericQ + c_C] :>
Simplify[# /.
Cases[#, a_?NumericQ + c_C :> (c :> c - a), Infinity],
rest]]}] &, Inactivate[dsol, Function], 100], Function];
Now
sol = DSolve[{f == y[x] + x*(1 - y'[x]^2)/2/y'[x]}, y[x], x]

Trying first solution. But simplifying it first
sol = sol // constSimplify2

Applying the initial conditions on first solution
sol[[1]] /. {y[x] -> f, x -> 0} /. Rule -> Equal

Solve[%, C[1]]
(* {{C[1] -> 0}} *)
Plugging C[1]=0
into the solution y[x] -> f + x^2/(4 C[1]) - C[1]
clearly gives division by zero.
Same for the second solution.
Therefore the initial condition gives no valid solution.
Update
-1. Can you elaborate your "Same for the second solution"?
I thought this was obvious. But here it is
sol[[2]] /. {y[x] -> f, x -> 0} /. Rule -> Equal

Solve[%, C[1]]
(* {{C[1] -> 0}} *)
Plugging the above in the second solution also gives divide by zero.
Btw, you could just have asked without downvoting at same time. I do not understand why you have to downvote for.