I am trying to implement Isolation forest for anomaly detection but I am not able to understand and visualise the decision function
According to this answer the range of output from scikit-learn IsolationForest decision_function is between -0.5 and 0.5, where smaller values mean more anomalous.
The predict function then applies a threshold to this function to get either -1 (anomaly) or 1 (not anomaly). The decision threshold is stored as model.threshold_ and defaults to 0.0.
So if you want to mark the decision threshold in a decision boundary plot, then you could use that value unless you have chosen another one. Note that it is quite common in Anomaly Detection to select your own threshold. Ideally it is selected by using a labeled validation set, or otherwise based on the histogram of anomaly scores.
As for interpreting the values that contribute to the anomaly scores, I would recommend using Shap for IsolationForest.