Let n = |A|. Thus A = {x1,x2,x3, ¼,xn}, where all elements are distinct.
Assume that f is a one-to-one function. Then for any integer j we have f(xi) ¹ f(xj) whenever 0 £ i < j. This implies that |{f(x1),f(x2),f(x3), ¼,f(xn)}| = n. Since {f(x1),f(x2),f(x3), ¼,f(xn)} Í B and |{f(x1),f(x2),f(x3), ¼,f(xn)}| = |B|, we can conclude that the range of f is B. Therefore, f is an onto function. Assume now that f is onto but it is not a one-to-one function. Then there exist integers i ¹ j such that f(xi) = f(xj). Thus, |{f(x1),f(x2),f(x3), ¼,f(xn)}| < n and since |B| = n, there must be an element of B so that no element of A is mapped on it by f. Thus, f is not onto, a contradiction.
Assume that f is a one-to-one function. Then for any integer j we have f(xi) ¹ f(xj) whenever 0 £ i < j. This implies that |{f(x1),f(x2),f(x3), ¼,f(xn)}| = n. Since {f(x1),f(x2),f(x3), ¼,f(xn)} Í B and |{f(x1),f(x2),f(x3), ¼,f(xn)}| = |B|, we can conclude that the range of f is B. Therefore, f is an onto function. Assume now that f is onto but it is not a one-to-one function. Then there exist integers i ¹ j such that f(xi) = f(xj). Thus, |{f(x1),f(x2),f(x3), ¼,f(xn)}| < n and since |B| = n, there must be an element of B so that no element of A is mapped on it by f. Thus, f is not onto, a contradiction.