Write down g({2, 4}).
So A is the domain and the codomain is solely comprised of integers. Does the top line (-1 if X = {}) mean output -1 if the input {2,4} is an element within the power set of A? and Does the bottom line (the smallest element of X if X != {}) mean output the smallest element of X if the input {2,4} is not an element within the power set of A?
I guessed that the answer is -1, seeing that {2,4} is an element within the power set of A. Have I completely misinterpreted the question?

You are given $X=\{2,4\}\in A$ (yes, $\{2,4\}$ is a subset of $\{1,2,3,4\}$ and hence an element of its powerset $A$) and want to compute $g(X)$, which is given by a case-wise definition. So plug in $\{2,4\}$ for $X$ in the formula that describes how to obtain $g(X)$.
As $\{2,4\}\ne\{\}$, the second case applies and so $g(\{2,4\})=\text{the smallest element of }\{2,4\}$. So the next question arises: What is the smallest element of $\{2,4\}$? Last time I checked, it was $2$. Hence ultimately, $$g(\{2,4\})=2. $$