#f(g(x))# is denoting the composition of #f# and #g#. Just as how if we were applying #f# to a number, we would substitute that number for each #x# in #f(x)#, as we are applying to #f# to #g(x)#, we substitute #g(x)# for each #x# in #f(x)#.
#f(g(x)) = g(x)+2 = (x-2)+2 = x#
As a side note, because #f(g(x)) = g(f(x)) = x#, we say that #f# and #g# are inverses of one another.