aa[n_] = n + Round[(Sqrt[n])]

bb[p_] = p - Floor[(Sqrt[p])]

Table[{n, aa[n]}, {n, 1, 78}] // TableForm

Table[{n, aa[n], bb[aa[n]]}, {n, 1, 78}] // TableForm

Max[Table[ Abs[n - bb[aa[n]]], {n, 1, 100000}]]

ff[n_] = (((-1))^n) Floor[n/2]

Table[ff[n], {n, 1, 100}]

UnitStep[0]

gg[n_] = 2  Abs[n] + UnitStep[-n]

gg[0]

gg[1]

gg[-1]