In mathematics, a function is a binary relation between two sets that associates every element of the first set to exactly one element of the second set. Let’s say these two sets are X and Y. Where x ∈ X and y ∈ Y a function is ordered pairs of these two sets (x, y). There can be only and only one (x, y) pair for one x ∈ X.
Let’s name this function “f” (insanely creative). The function f can be described as f(x) = y. This means if you put x as an “input” in the function “f” we will get “y” as an output. You can think the function is like a machine which can do anything you would like.

Let’s say, f(x) = 2x this function takes an “x” from the set of X and multiplies it by 2. Let’s test this function: x= 3, f(3)= 6 or x=5, f(5)=10.

f(a)=a^2 This function calculates the area of a square given the a = side.
Let’s try another example. This time we will use hexadecimal numbers instead of decimal numbers. f(x) = 3x + 7 and let’s choose x as A5C (in base 16, hexadecimal)
f(A5C) = 3(A5C) + 7 = 1F14 + 7 = 1F1B
Another one; f(x) = DE4A8(x) – 4AE5 and for x = 55F2:
f(55f2) = (de4a8)(55f2) – 4ae5 = 4aa0deed0 – 4ae5 = 4AA0DA3EB
Those examples above are very simple ones just to have a general idea what the functions are. And with the help of it, hopefully you will have a grasp of the hash functions and cryptographic hash functions. Understanding what simple mathematical functions allow you to see how this is related to blockchain and Bitcoin and why Merkle Trees are crucial for blockchain technology.

Thank you for reading. I hope, you enjoyed it and/or it helped you somehow.
Have a nice day :)